diff options
author | gabime <gmelman1@mgail.com> | 2020-09-26 14:41:33 +0300 |
---|---|---|
committer | gabime <gmelman1@mgail.com> | 2020-09-26 14:41:33 +0300 |
commit | 1ac2dcc53749031749618e19e7de0a418aa9e93d (patch) | |
tree | 9a8508c5150552117bc8de87ed28562df594b0dd /include/spdlog/cfg/helpers-inl.h | |
parent | 3a68eecb282c0c19527b9b52d951fbfbdb0881e6 (diff) |
wip fix #1680 again
Diffstat (limited to 'include/spdlog/cfg/helpers-inl.h')
-rw-r--r-- | include/spdlog/cfg/helpers-inl.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/include/spdlog/cfg/helpers-inl.h b/include/spdlog/cfg/helpers-inl.h index b0915073..81768e4d 100644 --- a/include/spdlog/cfg/helpers-inl.h +++ b/include/spdlog/cfg/helpers-inl.h @@ -73,27 +73,31 @@ inline std::unordered_map<std::string, std::string> extract_key_vals_(const std: continue; } auto kv = extract_kv_('=', token); + if (kv.first.empty()) + { + kv.first = "*"; + } rv[kv.first] = kv.second; } return rv; } -SPDLOG_INLINE log_levels extract_levels(const std::string &input) +SPDLOG_INLINE std::unordered_map<std::string, spdlog::level::level_enum> extract_levels(const std::string &input) { auto key_vals = extract_key_vals_(input); - log_levels rv; + std::unordered_map<std::string, spdlog::level::level_enum> rv; for (auto &name_level : key_vals) { auto &logger_name = name_level.first; auto level_name = to_lower_(name_level.second); auto level = level::from_str(level_name); - // fallback to "info" if unrecognized level name + // ignore unrecognized level names if (level == level::off && level_name != "off") { - level = level::info; + continue; } - rv.set(logger_name, level); + rv[logger_name] = level; } return rv; } |