logging: add LogError, LogWarning, LogInfo, LogDebug, LogTrace

These provide simple and clear ways to write the most common logging
operations:

    LogInfo("msg");
    LogDebug(BCLog::LogFlags::NET, "msg");

    LogError("msg");
    LogWarning("msg");
    LogTrace(BCLog::LogFlags::NET, "msg");

For cases where the level cannot be hardcoded, LogPrintLevel(category,
level, ...) remains available.
This commit is contained in:
Anthony Towns committed 2023-12-20 15:59:48 +10:00
1 parent fbd7642c8e
commit f7ce5ac08c
4 files changed
+81 -6

No files matched your search

+5
View File
@@ -20,6 +20,11 @@ FUNCTION_NAMES_AND_NUMBER_OF_LEADING_ARGUMENTS = [
'fprintf,1',
'tfm::format,1', # Assuming tfm::::format(std::ostream&, ...
'LogConnectFailure,1',
'LogError,0',
'LogWarning,0',
'LogInfo,0',
'LogDebug,1',
'LogTrace,1',
'LogPrint,1',
'LogPrintf,0',
'LogPrintfCategory,1',