Bitcoin Core PR #34806 refactors logging API
Bitcoin Core PR #34806, opened by ajtowns on Apr 27, 2026, refactors the logging API: ShrinkDebugFile now takes the logging mutex, NO_RATE_LIMIT can bypass throttling for critical logs, GetLogCategory moves out of the global namespace, ShouldLog is split into ShouldDebugLog / ShouldTraceLog, LogAcceptCategory is removed, and more files include util/log.h instead of logging.h.
Mechanically this is about safer and more explicit node logging: mutex protection targets races during logging initialization, rate-limit tags give controlled escape hatches for critical output, and the split logging predicates tighten signature-based filtering with less runtime ambiguity. The summary says this does not change consensus or transaction behavior.
Caveat from the review surface: adding mutexes may add contention in low-latency paths, NO_RATE_LIMIT depends on disciplined use, and the ShouldLog split only improves filtering if callers do not bypass the intended path.
Source:
#Bitcoin #BitcoinCore #FullNodes #NodeOps
GitHub
refactor: logging: Various API improvements by ajtowns · Pull Request #34806 · bitcoin/bitcoin
ShrinkDebugFile now takes the logging mutex for its entire run; though it's only called in init so shouldn't have any races in the first pl...
GitHub
refactor: logging: Various API improvements by ajtowns · Pull Request #34806 · bitcoin/bitcoin
ShrinkDebugFile now takes the logging mutex for its entire run; though it's only called in init so shouldn't have any races in the first pl...