From 2a450e85e73b2701fbcc75523be7946770870d32 Mon Sep 17 00:00:00 2001 From: WaruGameDev <60048774+WaruGameDev@users.noreply.github.com> Date: Mon, 23 Nov 2026 10:33:16 -0300 Subject: [PATCH] Log lines are flushed as they are written System::platformLog wrote with printf and never flushed. stdout is fully buffered when it is redirected to a file or a pipe, and a window app has no console, so the lines written before a crash or a killed process were lost (an empty log file). Each line is now flushed. Co-Authored-By: Claude Opus 5.5 --- engine/core/System.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine/core/System.cpp b/engine/core/System.cpp index 5e18f3dee..e9cdc4d96 100644 --- a/engine/core/System.cpp +++ b/engine/core/System.cpp @@ -179,6 +179,9 @@ void System::platformLog(const int type, const char *fmt, va_list args){ vprintf(fmt, args); printf("\n"); + // stdout is fully buffered when redirected to a file or pipe (and a window + // app has no console), so lines written before a crash or a kill were lost + fflush(stdout); } bool System::getBoolForKey(const char *key, bool defaultValue){