mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-12 17:00:25 +08:00
Don't throw wincolor redirection failed, to be consistent with the non-redirect behaviour
This commit is contained in:
parent
95c19876c6
commit
a9964afcf7
@ -155,11 +155,7 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::write_to_file_(const memory_buf_
|
||||
{
|
||||
auto size = static_cast<DWORD>(formatted.size());
|
||||
DWORD bytes_written = 0;
|
||||
bool ok = ::WriteFile(static_cast<HANDLE>(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<HANDLE>(out_handle_), formatted.data(), size, &bytes_written, nullptr);
|
||||
}
|
||||
|
||||
// wincolor_stdout_sink
|
||||
|
Loading…
Reference in New Issue
Block a user