From 880f3c173f0404777fc408c2bbf8b6e483d616fc Mon Sep 17 00:00:00 2001 From: scc Date: Mon, 20 Feb 2023 18:40:27 +0800 Subject: [PATCH] Fix stdout_sink_base::log's behavior inconsistency It will flush every time when it if not defined _WIN32, but not in Windows family. We viewed the commit #48d4ed9 for fixing issue #1675 . It seems missing this flushing operation in mistake. --- include/spdlog/sinks/stdout_sinks-inl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/spdlog/sinks/stdout_sinks-inl.h b/include/spdlog/sinks/stdout_sinks-inl.h index 756734bf..f8ad947c 100644 --- a/include/spdlog/sinks/stdout_sinks-inl.h +++ b/include/spdlog/sinks/stdout_sinks-inl.h @@ -68,6 +68,7 @@ SPDLOG_INLINE void stdout_sink_base::log(const details::log_msg &m { throw_spdlog_ex("stdout_sink_base: WriteFile() failed. GetLastError(): " + std::to_string(::GetLastError())); } + FlushFileBuffers(handle_); // flush every line to terminal #else std::lock_guard lock(mutex_); memory_buf_t formatted;