.
Some checks are pending
PR Check / on-push-commit-check (push) Waiting to run

This commit is contained in:
sha512sum 2024-12-24 17:25:46 +11:00
parent 44e75c8793
commit e750d184a6

View file

@ -30,7 +30,7 @@ auto main(int argc, char** argv) -> int {
// Define options
po::options_description desc("Allowed options");
desc.add_options()("help,h", "Print help message")("log_level,l",
po::value<int>()->default_value(SPDLOG_LEVEL_INFO),
po::value<int>()->default_value(SPDLOG_LEVEL_OFF),
"Set log level: 0=TRACE, 1=DEBUG, 2=INFO, 3=WARN, 4=ERROR, 5=CRITICAL, 6=OFF");
// Parse command-line arguments
@ -54,8 +54,10 @@ auto main(int argc, char** argv) -> int {
}
// Cmd options handling
spdlog::set_level(static_cast<spdlog::level::level_enum>(vm["log_level"].as<int>()));
std::println("\nEnvironment setup:\n\tCurrently set log level: {}\n", ToString(spdlog::get_level()));
auto level = static_cast<spdlog::level::level_enum>(vm["log_level"].as<int>());
spdlog::set_level(level);
if(level != spdlog::level::level_enum::off) {
std::println("\nEnvironment setup:\n\tCurrently set log level: {}\n", ToString(spdlog::get_level()));
}
return RUN_ALL_TESTS();
}
}