From 44a12db93184925628a14ebabdebdefe965a4f4c Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 18 Aug 2024 12:18:08 +1000 Subject: [PATCH] Log: Flush on every write Slower, but if we crash, need the whole thing. --- src/common/log.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/log.cpp b/src/common/log.cpp index 0dbe50cce..0bde241bd 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -413,6 +413,7 @@ void Log::FileOutputLogCallback(void* pUserParam, const char* channelName, const FormatLogMessageAndPrint(channelName, functionName, level, message, true, false, true, [](std::string_view message) { std::fwrite(message.data(), 1, message.size(), s_file_handle.get()); + std::fflush(s_file_handle.get()); }); }