Update wincolor_sink-inl.h

This commit is contained in:
Gabi Melman 2021-02-14 01:49:29 +02:00 committed by GitHub
parent 09cc6e7754
commit 42c5eb59c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,7 +128,8 @@ std::uint16_t SPDLOG_INLINE wincolor_sink<ConsoleMutex>::set_foreground_color_(s
CONSOLE_SCREEN_BUFFER_INFO orig_buffer_info;
if (!::GetConsoleScreenBufferInfo(static_cast<HANDLE>(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)