diff options
author | Jon Atack <jon@atack.com> | 2022-05-25 18:26:54 +0200 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2022-06-08 14:02:54 +0200 |
commit | eb8aab759fb15824a5dd3004e689d0eb5b884a32 (patch) | |
tree | 3dc6ec7fdb4199a4d5115a016355834f23c50a83 /src/test/logging_tests.cpp | |
parent | b9416c3847cd347238a9d75d949327f69e187d79 (diff) | |
download | bitcoin-eb8aab759fb15824a5dd3004e689d0eb5b884a32.tar.xz |
logging: add LogPrintfCategory to log unconditionally with category
prefixing the output with the passed category name.
- add documentation
- add a unit test
- update lint-logs.py
- update lint-format-strings.py
Diffstat (limited to 'src/test/logging_tests.cpp')
-rw-r--r-- | src/test/logging_tests.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test/logging_tests.cpp b/src/test/logging_tests.cpp index 3f6a605945..5a5e3b3f1f 100644 --- a/src/test/logging_tests.cpp +++ b/src/test/logging_tests.cpp @@ -103,6 +103,7 @@ BOOST_FIXTURE_TEST_CASE(logging_LogPrintMacros, LogSetup) LogPrintLevel(BCLog::NET, BCLog::Level::Info, "foo8: %s\n", "bar8"); LogPrintLevel(BCLog::NET, BCLog::Level::Warning, "foo9: %s\n", "bar9"); LogPrintLevel(BCLog::NET, BCLog::Level::Error, "foo10: %s\n", "bar10"); + LogPrintfCategory(BCLog::VALIDATION, "foo11: %s\n", "bar11"); std::ifstream file{tmp_log_path}; std::vector<std::string> log_lines; for (std::string log; std::getline(file, log);) { @@ -114,7 +115,9 @@ BOOST_FIXTURE_TEST_CASE(logging_LogPrintMacros, LogSetup) "[net:debug] foo7: bar7", "[net:info] foo8: bar8", "[net:warning] foo9: bar9", - "[net:error] foo10: bar10"}; + "[net:error] foo10: bar10", + "[validation] foo11: bar11", + }; BOOST_CHECK_EQUAL_COLLECTIONS(log_lines.begin(), log_lines.end(), expected.begin(), expected.end()); } |