Corrects the documentation for logging rpc and -debugexclude to match behaviour; removes the "0" and "" entries in LOG_CATEGORIES_BY_STR.
logging: Simplify edge cases in logging configuration #30384
pull ajtowns wants to merge 2 commits into bitcoin:master from ajtowns:202407-log-none changing 3 files +2 −6-
ajtowns commented at 12:57 PM on July 3, 2024: contributor
-
docs: correct -debug, -debugexclude and logging rpc docs to match behaviour a240772295
-
524f44df73
logging: remove 0/"" names for BCLog::NONE
The names in `LOG_CATEGORIES_BY_STR` are used to modify a bitfield, but modifying zero bits in a bitfield is a no-op, so including `BCLog::NONE` is not useful. This changes `-debugexclude=0` from being a no-op to being an error. `-debug=0` remains special-cased to override any other `-debug=xxx` options, and `-debug=` and `-debugexclude=` are also already special-cased to mean `BCLog::ALL` in `GetLogCategory()`. Likewise the logging RPC now gives an error if "0" is passed as a category instead of treating it as a no-op, and continues to treat "" the same as "all".
-
DrahtBot commented at 12:57 PM on July 3, 2024: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
Code Coverage
For detailed information about the code coverage, see the test coverage report.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline for information on the review process. A summary of reviews will appear here.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #29798 (Logging cleanup by vasild)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
-
ajtowns commented at 1:13 PM on July 3, 2024: contributor
See #27231 (comment) for history of the documented-but-not-working behaviour. As noted in the commit message, the "0" in LOG_CATEGORIES_BY_STR just changes an error into a no-op when passing a "0" category in, and the "" is entirely non-functional as its overridden elsewhere to be treated as BCLog::ALL anyway.
- ajtowns closed this on Jul 3, 2024
- bitcoin locked this on Jul 3, 2025