Allow debug logs to be excluded from specified component #10123

pull jnewbery wants to merge 1 commits into bitcoin:master from jnewbery:debugexclude changing 1 files +14 −1
  1. jnewbery commented at 3:32 PM on March 30, 2017: member

    setting -debug can lead to very noisy debug.logs with subcomponents filling up the log file. See for example https://travis-ci.org/bitcoin/bitcoin/jobs/216767286 where there are hundreds of libevent debug logs.

    This commit adds an option to exclude certain components from debug logging. The usage is:

    bitcoind -debug -debugexclude=<component1> -debugexclude=<component2> ...
    
  2. TheBlueMatt commented at 3:39 PM on March 30, 2017: contributor

    utACK 3f1cbd38896cea8cea3095aad0a23254a39f651e

  3. jnewbery cross-referenced this on Mar 30, 2017 from issue [test] Suppress test logging spam by jnewbery
  4. JeremyRubin commented at 4:22 PM on March 30, 2017: contributor

    utACK 3f1cbd3.

    Might be good to clean the category code up in another PR.

  5. jnewbery commented at 5:23 PM on March 30, 2017: member

    @JeremyRubin agree - this could be optimized so we don't do a std::string.count() every time LogPrint() is called. I think that's an improvement for a different PR. This doesn't make things particularly worse.

  6. jnewbery cross-referenced this on Mar 30, 2017 from issue Change LogAcceptCategory to use uint32_t rather than sets of strings. by gmaxwell
  7. fanquake added the label Utils and libraries on Mar 30, 2017
  8. jnewbery commented at 8:48 PM on March 31, 2017: member

    Closing until #9424 is merged.

  9. jnewbery closed this on Mar 31, 2017

  10. laanwj commented at 6:56 AM on April 2, 2017: member

    #9424 was merged

  11. jnewbery commented at 11:53 PM on April 2, 2017: member

    Reimplemented on top of the new logging categories infrastructure from #9424. As expected, it's about 10 lines of code.

    Requesting review from @gmaxwell .

  12. jnewbery reopened this on Apr 2, 2017

  13. jnewbery closed this on Apr 2, 2017

  14. jnewbery force-pushed on Apr 2, 2017
  15. jnewbery reopened this on Apr 2, 2017

  16. in src/init.cpp:917 in 39a70f26d9 outdated
     914 | @@ -914,13 +915,25 @@ bool AppInitParameterInteraction()
     915 |              for (const auto& cat : categories) {
     916 |                  uint32_t flag;
     917 |                  if (!GetLogCategory(&flag, &cat)) {
     918 | -                    InitWarning(strprintf(_("Unsupported logging category %s.\n"), cat));
    


    laanwj commented at 10:23 AM on April 3, 2017:

    To not give the translators extra work, please try to use the same translation message as below. You could add a %s for the option.


    jnewbery commented at 1:05 PM on April 3, 2017:

    Good point. Changed.

  17. laanwj commented at 10:29 AM on April 3, 2017: member
  18. Add -debugexclude option to switch off logging for specified components 3bde556429
  19. jnewbery force-pushed on Apr 3, 2017
  20. jnewbery commented at 1:05 PM on April 3, 2017: member

    @laanwj's nit fixed and squashed.

  21. laanwj merged this on Apr 3, 2017
  22. laanwj closed this on Apr 3, 2017

  23. laanwj referenced this in commit 471ed00fcd on Apr 3, 2017
  24. jnewbery deleted the branch on Apr 3, 2017
  25. dagurval cross-referenced this on Mar 7, 2018 from issue Reduce noise in QA logs by dagurval
  26. PastaPastaPasta referenced this in commit ddd9b0dbac on May 12, 2019
  27. PastaPastaPasta referenced this in commit 7b9a01e711 on May 12, 2019
  28. UdjinM6 referenced this in commit b49d904426 on May 16, 2019
  29. PastaPastaPasta referenced this in commit 92b9de7cda on May 17, 2019
  30. PastaPastaPasta referenced this in commit 29aa826696 on May 21, 2019
  31. PastaPastaPasta referenced this in commit 7c3056c30b on May 21, 2019
  32. PastaPastaPasta referenced this in commit 456e1321a0 on May 21, 2019
  33. PastaPastaPasta referenced this in commit 0007611c75 on May 22, 2019
  34. PastaPastaPasta referenced this in commit 34e954a0d0 on May 22, 2019
  35. UdjinM6 referenced this in commit 29194b1f5a on May 22, 2019
  36. barrystyle referenced this in commit b773a6230f on Jan 22, 2020
  37. random-zebra cross-referenced this on Mar 20, 2020 from issue [Core] Add -debugexclude option by random-zebra
  38. random-zebra referenced this in commit eb1ed66c2e on Apr 4, 2020
  39. unknown cross-referenced this on Sep 2, 2020 from issue ERROR AcceptBlockHeader log messages are kind of noisy by laanwj
  40. bitcoin locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:54 UTC