From 81e82fb2d39f00c3e91a90a74a045fcc187f8dd4 Mon Sep 17 00:00:00 2001 From: gabime Date: Mon, 15 Jul 2019 12:22:34 +0300 Subject: [PATCH] Rename func name wincolor sink --- include/spdlog/sinks/wincolor_sink-inl.h | 6 +++--- include/spdlog/sinks/wincolor_sink.h | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/spdlog/sinks/wincolor_sink-inl.h b/include/spdlog/sinks/wincolor_sink-inl.h index 854a6dc8..e8b9192e 100644 --- a/include/spdlog/sinks/wincolor_sink-inl.h +++ b/include/spdlog/sinks/wincolor_sink-inl.h @@ -66,7 +66,7 @@ void SPDLOG_INLINE wincolor_sink::log(const details::log_msg &msg) print_range_(formatted, 0, msg.color_range_start); // in color range - auto orig_attribs = set_console_attribs(colors_[msg.level]); + auto orig_attribs = set_foreground_color_(colors_[msg.level]); print_range_(formatted, msg.color_range_start, msg.color_range_end); // reset to orig colors ::SetConsoleTextAttribute(out_handle_, orig_attribs); @@ -115,9 +115,9 @@ void SPDLOG_INLINE wincolor_sink::set_color_mode(color_mode mode) } } -// set color and return the orig console attributes (for resetting later) +// set foreground color and return the orig console attributes (for resetting later) template -WORD SPDLOG_INLINE wincolor_sink::set_console_attribs(WORD attribs) +WORD SPDLOG_INLINE wincolor_sink::set_foreground_color_(WORD attribs) { CONSOLE_SCREEN_BUFFER_INFO orig_buffer_info; ::GetConsoleScreenBufferInfo(out_handle_, &orig_buffer_info); diff --git a/include/spdlog/sinks/wincolor_sink.h b/include/spdlog/sinks/wincolor_sink.h index e9578bc0..0ff43e07 100644 --- a/include/spdlog/sinks/wincolor_sink.h +++ b/include/spdlog/sinks/wincolor_sink.h @@ -54,8 +54,9 @@ protected: std::unique_ptr formatter_; std::unordered_map colors_; - // set color and return the orig console attributes (for resetting later) - WORD set_console_attribs(WORD attribs); + // set foreground color and return the orig console attributes (for resetting later) + WORD set_foreground_color_(WORD attribs); + // print a range of formatted message to console void print_range_(const fmt::memory_buffer &formatted, size_t start, size_t end);