From 42c5eb59c9a44e4fafa4c5dae95ecd8269df5f35 Mon Sep 17 00:00:00 2001 From: Gabi Melman Date: Sun, 14 Feb 2021 01:49:29 +0200 Subject: [PATCH] Update wincolor_sink-inl.h --- include/spdlog/sinks/wincolor_sink-inl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/spdlog/sinks/wincolor_sink-inl.h b/include/spdlog/sinks/wincolor_sink-inl.h index 1c5bca26..092c7655 100644 --- a/include/spdlog/sinks/wincolor_sink-inl.h +++ b/include/spdlog/sinks/wincolor_sink-inl.h @@ -128,7 +128,8 @@ std::uint16_t SPDLOG_INLINE wincolor_sink::set_foreground_color_(s CONSOLE_SCREEN_BUFFER_INFO orig_buffer_info; if (!::GetConsoleScreenBufferInfo(static_cast(out_handle_), &orig_buffer_info)) { - return FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; // white + // just return white if failed getting console info + return FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; } // change only the foreground bits (lowest 4 bits)