diff --git a/example/example.cpp b/example/example.cpp index a4f8d11b..73349003 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -23,10 +23,10 @@ void syslog_example(); #include #include -int main(int args, const char *argv[]) +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/include/spdlog/loaders/argv.h b/include/spdlog/loaders/argv.h index 9fe45059..736b8c49 100644 --- a/include/spdlog/loaders/argv.h +++ b/include/spdlog/loaders/argv.h @@ -36,9 +36,5 @@ void load_argv(int args, char **argv) } } -void load_argv(int args, const char **argv) -{ - return load_argv(args, const_cast(argv)); -} } // namespace loaders } // namespace spdlog diff --git a/tests/test_loaders.cpp b/tests/test_loaders.cpp index fdc3346a..be4643b1 100644 --- a/tests/test_loaders.cpp +++ b/tests/test_loaders.cpp @@ -20,7 +20,7 @@ TEST_CASE("env", "[loaders]") TEST_CASE("argv1", "[loaders]") { const char *argv[] = {"ignore", "SPDLOG_LEVEL=l1=warn"}; - load_argv(2, argv); + load_argv(2, const_cast(argv)); auto l1 = spdlog::create("l1"); REQUIRE(l1->level() == spdlog::level::warn); REQUIRE(spdlog::default_logger()->level() == spdlog::level::info); @@ -30,7 +30,7 @@ TEST_CASE("argv1", "[loaders]") TEST_CASE("argv2", "[loaders]") { const char *argv[] = {"ignore", "SPDLOG_LEVEL=l1=warn,trace"}; - load_argv(2, argv); + load_argv(2, const_cast(argv)); auto l1 = spdlog::create("l1"); REQUIRE(l1->level() == spdlog::level::warn); REQUIRE(spdlog::default_logger()->level() == spdlog::level::trace); @@ -40,7 +40,7 @@ TEST_CASE("argv2", "[loaders]") TEST_CASE("argv3", "[loaders]") { const char *argv[] = {"ignore", "SPDLOG_LEVEL="}; - load_argv(2, argv); + load_argv(2, const_cast(argv)); auto l1 = spdlog::create("l1"); REQUIRE(l1->level() == spdlog::level::info); REQUIRE(spdlog::default_logger()->level() == spdlog::level::info); @@ -50,7 +50,7 @@ TEST_CASE("argv3", "[loaders]") TEST_CASE("argv4", "[loaders]") { const char *argv[] = {"ignore", "SPDLOG_LEVEL=junk"}; - load_argv(2, argv); + load_argv(2, const_cast(argv)); auto l1 = spdlog::create("l1"); REQUIRE(l1->level() == spdlog::level::info); spdlog::drop(l1->name());