aboutsummaryrefslogtreecommitdiff
path: root/src/test/logging_tests.cpp
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2023-05-12 00:58:35 +0200
committerJon Atack <jon@atack.com>2023-06-14 08:27:46 -0600
commita9c295888b82c86ef4629aa2d9061ea152b48f20 (patch)
tree95deaed578ab6dac62097b6d814854689198798f /src/test/logging_tests.cpp
parentb0c3995393c592fa96306e077ed64e65d5400882 (diff)
init: raise on invalid loglevel config option
Diffstat (limited to 'src/test/logging_tests.cpp')
-rw-r--r--src/test/logging_tests.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/test/logging_tests.cpp b/src/test/logging_tests.cpp
index beb9398c74..2699d316da 100644
--- a/src/test/logging_tests.cpp
+++ b/src/test/logging_tests.cpp
@@ -200,7 +200,9 @@ BOOST_FIXTURE_TEST_CASE(logging_Conf, LogSetup)
const char* argv_test[] = {"bitcoind", "-loglevel=debug"};
std::string err;
BOOST_REQUIRE(args.ParseParameters(2, argv_test, err));
- init::SetLoggingLevel(args);
+
+ auto result = init::SetLoggingLevel(args);
+ BOOST_REQUIRE(result);
BOOST_CHECK_EQUAL(LogInstance().LogLevel(), BCLog::Level::Debug);
}
@@ -212,7 +214,9 @@ BOOST_FIXTURE_TEST_CASE(logging_Conf, LogSetup)
const char* argv_test[] = {"bitcoind", "-loglevel=net:trace"};
std::string err;
BOOST_REQUIRE(args.ParseParameters(2, argv_test, err));
- init::SetLoggingLevel(args);
+
+ auto result = init::SetLoggingLevel(args);
+ BOOST_REQUIRE(result);
BOOST_CHECK_EQUAL(LogInstance().LogLevel(), BCLog::DEFAULT_LOG_LEVEL);
const auto& category_levels{LogInstance().CategoryLevels()};
@@ -229,7 +233,9 @@ BOOST_FIXTURE_TEST_CASE(logging_Conf, LogSetup)
const char* argv_test[] = {"bitcoind", "-loglevel=debug", "-loglevel=net:trace", "-loglevel=http:info"};
std::string err;
BOOST_REQUIRE(args.ParseParameters(4, argv_test, err));
- init::SetLoggingLevel(args);
+
+ auto result = init::SetLoggingLevel(args);
+ BOOST_REQUIRE(result);
BOOST_CHECK_EQUAL(LogInstance().LogLevel(), BCLog::Level::Debug);
const auto& category_levels{LogInstance().CategoryLevels()};