diff --git a/example/example.cpp b/example/example.cpp index 73349003..fd383f2f 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -25,8 +25,7 @@ void syslog_example(); int main(int args, char *argv[]) { - - //spdlog::loaders::load_env(); + spdlog::loaders::load_env(); spdlog::loaders::load_argv(args, argv); spdlog::info("HELLO INFO"); diff --git a/tests/test_loaders.cpp b/tests/test_loaders.cpp index be4643b1..bf8f9416 100644 --- a/tests/test_loaders.cpp +++ b/tests/test_loaders.cpp @@ -55,3 +55,13 @@ TEST_CASE("argv4", "[loaders]") REQUIRE(l1->level() == spdlog::level::info); spdlog::drop(l1->name()); } + +TEST_CASE("argv5", "[loaders]") +{ + const char *argv[] = {"ignore", "ignore", "SPDLOG_LEVEL=l1=warn,trace"}; + load_argv(3, const_cast(argv)); + auto l1 = spdlog::create("l1"); + REQUIRE(l1->level() == spdlog::level::warn); + REQUIRE(spdlog::default_logger()->level() == spdlog::level::trace); + spdlog::drop(l1->name()); +}