mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-26 15:39:03 +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());
|
auto size = static_cast<DWORD>(formatted.size());
|
||||||
DWORD bytes_written = 0;
|
DWORD bytes_written = 0;
|
||||||
bool ok = ::WriteFile(static_cast<HANDLE>(out_handle_), formatted.data(), size, &bytes_written, nullptr) != 0;
|
::WriteFile(static_cast<HANDLE>(out_handle_), formatted.data(), size, &bytes_written, nullptr);
|
||||||
if (!ok)
|
|
||||||
{
|
|
||||||
throw_spdlog_ex("wincolor_sink: ::WriteFile() failed. GetLastError(): " + std::to_string(::GetLastError()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// wincolor_stdout_sink
|
// wincolor_stdout_sink
|
||||||
|
Loading…
Reference in New Issue
Block a user