diff --git a/include/spdlog/sinks/wincolor_sink-inl.h b/include/spdlog/sinks/wincolor_sink-inl.h index 59f1d4f4..28cf6f8c 100644 --- a/include/spdlog/sinks/wincolor_sink-inl.h +++ b/include/spdlog/sinks/wincolor_sink-inl.h @@ -155,11 +155,7 @@ void SPDLOG_INLINE wincolor_sink::write_to_file_(const memory_buf_ { auto size = static_cast(formatted.size()); DWORD bytes_written = 0; - bool ok = ::WriteFile(static_cast(out_handle_), formatted.data(), size, &bytes_written, nullptr) != 0; - if (!ok) - { - throw_spdlog_ex("wincolor_sink: ::WriteFile() failed. GetLastError(): " + std::to_string(::GetLastError())); - } + ::WriteFile(static_cast(out_handle_), formatted.data(), size, &bytes_written, nullptr); } // wincolor_stdout_sink