1 minor finding · 3 suggestions
Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.
Findings
[minor] · -loglevel results depend on option order
Mixing global and per-category -loglevel values can silently lose or add debug/trace output, depending on option order.
Location: src/init/common.cpp:73 (head).
Details and suggested fix
SetLoggingLevel applies each -loglevel value immediately to the live masks. Both branches use the current Debug mask to determine which categories they affect, so earlier options change the effect of later ones. For example, with -debug=net -loglevel=info -loglevel=net:trace, NET logs nothing, whereas the base logged NET at trace. Likewise, -loglevel=net:trace -loglevel=debug drops NET trace, while -debug=net -loglevel=net:debug -loglevel=trace raises NET to trace. The base stored global and per-category levels separately, and per-category levels took precedence regardless of option order. This matters because command-line values precede config-file values: -loglevel=walletdb:debug on the command line plus loglevel=trace in bitcoin.conf enables walletdb SQL statement tracing. The help still says a category setting overrides the global one. Snapshot the mask produced by -debug and -debugexclude before processing levels; apply the global level to that snapshot, then apply category levels to the snapshot intersected with each category flag. Add tests for both option orderings and for a global info followed by a category override.
Optional improvements
[suggestion] · Including an active category lowers its threshold from trace to debug
Including an already-active category now drops its trace output, although the release note describes only re-enabling categories.
Location: src/rpc/node.cpp:225 (head).
Details and suggested fix
EnableOrDisableLogCategories sets every included category to Debug, which clears its Trace bit. Previously, including a category only enabled it and left its level unchanged. Thus, on a node started with -debug -loglevel=trace, logging ["all"] ["http"] or logging include=['net'] lowers the included categories to Debug until restart. The release note describes restoring levels when re-enabling categories, but does not clearly cover categories that were never disabled. If newly enabled categories should start at Debug, apply that level only to categories that are not already enabled, preserving the prior no-op for active categories. If inclusion is intended to reset active categories too, state that behavior explicitly in the release note.
[suggestion] · An info threshold changes category status and startup defaults
With -debug=<cat> -loglevel=info, category status, debug-log shrinking, and GUI details change at startup, despite unchanged log output.
Location: src/init/common.cpp:129 (head).
Details and suggested fix
In the base, -debug=net -loglevel=info or -loglevel=net:info kept NET in m_categories and raised its threshold. Now setting the threshold to Info clears NET from both masks, while related code checks the Debug mask. As a result, the logging RPC reports net: false, -shrinkdebugfile defaults to true and can trim an existing debug.log over 11 MB to its last 10 MB, and the GUI transaction dialog omits its “Debug information” section. Log output itself is unchanged. This behavior may be more accurate, but it is not described in the release note, and the -shrinkdebugfile help still says its default is 1 when no -debug option is set. Document these effects in the release note and update the help, or add a test that pins the intended behavior for -debug=<cat> -loglevel=info.
[suggestion] · logging.h uses std::unordered_map without including its header
LogRateLimiter still declares an std::unordered_map member, so logging.h now relies on a transitive include.
Location: src/logging.h:27 (base).
Details and suggested fix
The change removes <unordered_map> from logging.h along with m_category_log_levels, but LogRateLimiter::m_source_locations still uses std::unordered_map. Other files that include logging.h therefore depend on another include supplying the declaration; adding the include to logging.cpp does not address that dependency. The file is also outside the IWYU-enforced set listed in ci/test/03_test_script.sh. Restore the <unordered_map> include in logging.h.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: Test category-specific debug selection with global log levels