Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gabime/spdlog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgabime <gmelman1@mgail.com>2020-09-25 15:03:13 +0300
committergabime <gmelman1@mgail.com>2020-09-25 15:03:13 +0300
commit54a8259b42844d698a275295a84e73e4fb3c87e5 (patch)
tree9009458e51abbd255a4bd7526d03eba45b17dfc4 /include/spdlog/cfg/env.h
parent32b6f1619fdf16b875fa34f2f20386c822c4e3df (diff)
Fix #1680
Diffstat (limited to 'include/spdlog/cfg/env.h')
-rw-r--r--include/spdlog/cfg/env.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/spdlog/cfg/env.h b/include/spdlog/cfg/env.h
index 98d63a22..e2dc5717 100644
--- a/include/spdlog/cfg/env.h
+++ b/include/spdlog/cfg/env.h
@@ -28,8 +28,11 @@ namespace cfg {
inline void load_env_levels()
{
auto env_val = details::os::getenv("SPDLOG_LEVEL");
- auto levels = helpers::extract_levels(env_val);
- details::registry::instance().update_levels(std::move(levels));
+ if (!env_val.empty())
+ {
+ auto levels = helpers::extract_levels(env_val);
+ details::registry::instance().update_levels(std::move(levels));
+ }
}
} // namespace cfg