Allow LogDebug()
, LogTrace()
, LogInfo()
, LogWarning()
, and LogError()
macros to accept context arguments to provide more information in log messages and more control over logging to callers.
This functionality is used in followup PRs:
-
#30342 - To let libbitcoinkernel send output to specfic
BCLog::Logger
instances instead of a global instance, so output can be disambiguated and applications can have more control over logging. -
#30343 - To replace custom
WalletLogPrintf
calls with standard logging calls that automatically include wallet names and don’t log everything at info level.
This PR does not change behavior of current log prints or require them to be updated. It includes tests and documentation covering the new functionality.
Note: Originally this PR also removed some restrictions around passing category constants to log macros to try to make them more consistent, but these changes were too controversial and have been dropped.