diff --git a/tests/main.cpp b/tests/main.cpp index 45ab76b..f49e3ee 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -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()->default_value(SPDLOG_LEVEL_INFO), + po::value()->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(vm["log_level"].as())); - std::println("\nEnvironment setup:\n\tCurrently set log level: {}\n", ToString(spdlog::get_level())); - + auto level = static_cast(vm["log_level"].as()); + 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(); -} \ No newline at end of file +}