mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-16 00:45:48 +08:00
Fix win-color sink redirection to file
This commit is contained in:
parent
50ed27946d
commit
38e5dbd866
@ -150,7 +150,7 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::write_to_file_(const fmt::memory
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
DWORD bytes_written = 0;
|
DWORD bytes_written = 0;
|
||||||
bool ok = WriteFile(out_handle_, formatted.data(), size, &bytes_written, nullptr) != 0;
|
bool ok = WriteFile(out_handle_, formatted.data()+total_written, size-total_written, &bytes_written, nullptr) != 0;
|
||||||
if (!ok || bytes_written == 0)
|
if (!ok || bytes_written == 0)
|
||||||
{
|
{
|
||||||
throw spdlog_ex("wincolor_sink: write_to_file_ failed. GetLastError(): " + std::to_string(::GetLastError()));
|
throw spdlog_ex("wincolor_sink: write_to_file_ failed. GetLastError(): " + std::to_string(::GetLastError()));
|
||||||
|
Loading…
Reference in New Issue
Block a user