This commit is contained in:
gabime 2019-12-13 12:44:11 +02:00
parent 5d4e6f17ee
commit cd8d7e6de9
2 changed files with 3 additions and 0 deletions

View File

@ -14,6 +14,7 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include <sstream> #include <sstream>
#include <cassert>
namespace spdlog { namespace spdlog {
namespace env { namespace env {
@ -96,6 +97,7 @@ inline details::registry::logger_cfgs from_env_()
for (auto &name_level : levels) for (auto &name_level : levels)
{ {
auto &logger_name = name_level.first; auto &logger_name = name_level.first;
assert(!logger_name.empty());
auto level_name = to_lower_(name_level.second); auto level_name = to_lower_(name_level.second);
details::registry::logger_cfg cfg; details::registry::logger_cfg cfg;
cfg.level_name = level_name; cfg.level_name = level_name;

View File

@ -260,6 +260,7 @@ SPDLOG_INLINE void registry::set_automatic_registration(bool automatic_registrat
automatic_registration_ = automatic_registration; automatic_registration_ = automatic_registration;
} }
SPDLOG_INLINE void registry::set_configs(logger_cfgs configs) SPDLOG_INLINE void registry::set_configs(logger_cfgs configs)
{ {
std::lock_guard<std::mutex> lock(logger_map_mutex_); std::lock_guard<std::mutex> lock(logger_map_mutex_);