Skip to content

Commit

Permalink
Fix #1680
Browse files Browse the repository at this point in the history
  • Loading branch information
gabime committed Sep 25, 2020
1 parent 32b6f16 commit 54a8259
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions include/spdlog/cfg/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 54a8259

Please sign in to comment.