logging: add LogError, LogWarning, LogInfo, LogDebug, LogTrace
Summary:
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 is a partial backport of core#28318
https://github.com/bitcoin/bitcoin/pull/28318/commits/f7ce5ac08c669ac763e275bb7c82dcfb2b1b6c33
Depends on D18274
Test Plan:
arc lint ninja all check-all
in the next diff try removing some "\n" in the newly added LogInfo/LogWarning lines, see that the linter catches the issue.
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D18275