From cd5ddca00de050b0679e2187ebdfc42bce4d79f5 Mon Sep 17 00:00:00 2001 From: gabime Date: Sat, 21 Dec 2019 17:55:30 +0200 Subject: [PATCH] wip --- include/spdlog/cfg/helpers-inl.h | 4 ++-- include/spdlog/cfg/helpers.h | 2 -- include/spdlog/cfg/log_levels.h | 9 ++++----- src/cfg.cpp | 1 - 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/include/spdlog/cfg/helpers-inl.h b/include/spdlog/cfg/helpers-inl.h index 87c270e3..a6b75a1e 100644 --- a/include/spdlog/cfg/helpers-inl.h +++ b/include/spdlog/cfg/helpers-inl.h @@ -19,7 +19,6 @@ namespace spdlog { namespace cfg { namespace helpers { -using name_val_pair = std::pair; // inplace convert to lowercase inline std::string &to_lower_(std::string &str) @@ -44,7 +43,8 @@ inline std::string &trim_(std::string &str) // " key = val " => ("key", "val") // "key=" => ("key", "") // "val" => ("", "val") -inline name_val_pair extract_kv_(char sep, const std::string &str) + +inline std::pair extract_kv_(char sep, const std::string &str) { auto n = str.find(sep); std::string k, v; diff --git a/include/spdlog/cfg/helpers.h b/include/spdlog/cfg/helpers.h index c9738770..23c2615e 100644 --- a/include/spdlog/cfg/helpers.h +++ b/include/spdlog/cfg/helpers.h @@ -4,9 +4,7 @@ #pragma once #include -#include #include -#include // // Init levels from given string diff --git a/include/spdlog/cfg/log_levels.h b/include/spdlog/cfg/log_levels.h index db7a958d..fcfba2bd 100644 --- a/include/spdlog/cfg/log_levels.h +++ b/include/spdlog/cfg/log_levels.h @@ -11,10 +11,11 @@ namespace spdlog { namespace cfg { class log_levels { + using levels_map = std::unordered_map; + levels_map levels_; + spdlog::level::level_enum default_level_ = level::info; public: - using levels_map = std::unordered_map; - void set(const std::string &logger_name, level::level_enum lvl) { if (logger_name.empty()) @@ -38,9 +39,7 @@ public: return default_level_; } -private: - levels_map levels_; - spdlog::level::level_enum default_level_ = level::info; + }; } // namespace cfg } // namespace spdlog diff --git a/src/cfg.cpp b/src/cfg.cpp index 1f4a4c7f..e9e3ae09 100644 --- a/src/cfg.cpp +++ b/src/cfg.cpp @@ -6,4 +6,3 @@ #endif #include "spdlog/cfg/helpers-inl.h" -