This commit is contained in:
gabime 2019-12-21 20:01:25 +02:00
parent 1a1c37db7c
commit de20255c71
2 changed files with 11 additions and 2 deletions

View File

@ -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");

View File

@ -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<char**>(argv));
auto l1 = spdlog::create<spdlog::sinks::test_sink_st>("l1");
REQUIRE(l1->level() == spdlog::level::warn);
REQUIRE(spdlog::default_logger()->level() == spdlog::level::trace);
spdlog::drop(l1->name());
}