Replace LogPrint*
functions with severity based logging functions:
LogInfo(...)
,LogWarning(...)
,LogError(...)
for unconditional (uncategorised) logging (replacesLogPrintf
)LogDebug(CATEGORY, ...)
andLogTrace(CATEGORY, ...)
for conditional logging (replacesLogPrint
)LogPrintLevel(CATEGORY, LEVEL, ...)
for when the level isn’t known in advance, or a category needs to be added for an info/warning/error log message (mostly unchanged, but rarely needed)
Logs look roughly as they do now with LogInfo
not having an [info]
prefix, and LogDebug
having a [cat]
prefix, rather than a [cat:debug]
prefix. This removes BCLog::Level::None
entirely – for LogFlags::NONE
just use Level::Info
, for any actual category, use Level::Debug
.
Adds docs to developer-notes about when to use which level.
Adds -loglevelalways=1
option so that you get [net:debug]
, [all:info]
, [all:warning]
etc, which might be helpful for automated parsing, or just if you like everything to be consistent. Defaults to off to reduce noise in the default config, and to avoid unnecessary changes on upgrades.
Changes the behaviour of LogPrintLevel(CATEGORY, BCLog::Level::Info, ...)
to be logged unconditionally, rather than only being an additional optional logging level in addition to trace and debug. Does not change the behaviour of LogPrintLevel(NONE, Debug, ...)
and LogPrintLevel(NONE, Trace, ...)
being no-ops.