mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-30 02:19:35 +08:00
Cleaned level loading from env var
This commit is contained in:
@@ -27,6 +27,7 @@ class periodic_worker;
|
||||
class SPDLOG_API registry
|
||||
{
|
||||
public:
|
||||
using log_levels = std::unordered_map<std::string, level::level_enum>;
|
||||
registry(const registry &) = delete;
|
||||
registry &operator=(const registry &) = delete;
|
||||
|
||||
@@ -79,7 +80,8 @@ public:
|
||||
|
||||
void set_automatic_registration(bool automatic_registration);
|
||||
|
||||
void set_levels(std::unordered_map<std::string, spdlog::level::level_enum> levels);
|
||||
// set levels for all existing/future loggers. global_level can be null if should not set.
|
||||
void set_levels(log_levels levels, level::level_enum *global_level);
|
||||
|
||||
static registry &instance();
|
||||
|
||||
@@ -93,7 +95,7 @@ private:
|
||||
std::mutex logger_map_mutex_, flusher_mutex_;
|
||||
std::recursive_mutex tp_mutex_;
|
||||
std::unordered_map<std::string, std::shared_ptr<logger>> loggers_;
|
||||
std::unordered_map<std::string, spdlog::level::level_enum> cfg_levels_;
|
||||
log_levels log_levels_;
|
||||
std::unique_ptr<formatter> formatter_;
|
||||
spdlog::level::level_enum global_log_level_ = level::info;
|
||||
level::level_enum flush_level_ = level::off;
|
||||
|
Reference in New Issue
Block a user