diff --git a/src/test/logging_tests.cpp b/src/test/logging_tests.cpp index 42658e940a7..809f27b28ff 100644 --- a/src/test/logging_tests.cpp +++ b/src/test/logging_tests.cpp @@ -203,22 +203,25 @@ BOOST_FIXTURE_TEST_CASE(logging_LogPrintMacros_CategoryName, LogSetup) BOOST_FIXTURE_TEST_CASE(logging_SeverityLevels, LogSetup) { + LogInstance().SetLogLevel(BCLog::Level::Debug); LogInstance().EnableCategory(BCLog::LogFlags::ALL); LogInstance().SetCategoryLogLevel(/*category_str=*/"net", /*level_str=*/"info"); // Global log level LogPrintLevel(BCLog::HTTP, BCLog::Level::Info, "foo1: %s\n", "bar1"); - LogPrintLevel(BCLog::MEMPOOL, BCLog::Level::Trace, "foo2: %s. This log level is lower than the global one.\n", "bar2"); + LogTrace(BCLog::HTTP, "trace_%s. This log level is lower than the global one.", 2); + LogDebug(BCLog::HTTP, "debug_%s", 3); LogPrintLevel(BCLog::VALIDATION, BCLog::Level::Warning, "foo3: %s\n", "bar3"); LogPrintLevel(BCLog::RPC, BCLog::Level::Error, "foo4: %s\n", "bar4"); // Category-specific log level LogPrintLevel(BCLog::NET, BCLog::Level::Warning, "foo5: %s\n", "bar5"); - LogPrintLevel(BCLog::NET, BCLog::Level::Debug, "foo6: %s. This log level is the same as the global one but lower than the category-specific one, which takes precedence. \n", "bar6"); + LogDebug(BCLog::NET, "debug_%s. This log level is the same as the global one but lower than the category-specific one, which takes precedence.", 6); LogPrintLevel(BCLog::NET, BCLog::Level::Error, "foo7: %s\n", "bar7"); std::vector expected = { "[http:info] foo1: bar1", + "[http] debug_3", "[validation:warning] foo3: bar3", "[rpc:error] foo4: bar4", "[net:warning] foo5: bar5",