From 05b2aabe0eaba7e3722a990eac9f592b6e2909bd Mon Sep 17 00:00:00 2001 From: Benjamin Schindler Date: Thu, 8 Feb 2018 09:14:45 +0100 Subject: [PATCH] Make set_color public in wincolor_sink to retain configurability --- include/spdlog/sinks/wincolor_sink.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/spdlog/sinks/wincolor_sink.h b/include/spdlog/sinks/wincolor_sink.h index f9e86c7a..d8211fb1 100644 --- a/include/spdlog/sinks/wincolor_sink.h +++ b/include/spdlog/sinks/wincolor_sink.h @@ -50,6 +50,13 @@ public: wincolor_sink(const wincolor_sink& other) = delete; wincolor_sink& operator=(const wincolor_sink& other) = delete; + // change the color for the given level + void set_color(level::level_enum level, WORD color) + { + std::lock_guard lock(base_sink::_mutex); + colors_[level] = color; + } + protected: virtual void _sink_it(const details::log_msg& msg) override { @@ -64,13 +71,6 @@ protected: // windows console always flushed? } - // change the color for the given level - void set_color(level::level_enum level, WORD color) - { - std::lock_guard lock(base_sink::_mutex); - colors_[level] = color; - } - private: HANDLE out_handle_; std::unordered_map colors_;