commit 3737b31fd9e4f6d54aa775e56e45c41d218fa8a7
Author: Jon Bell <j.to.the.bell@gmail.com>
AuthorDate: Mon Dec 29 13:44:45 2025 -0700
Commit: Jon Bell <j.to.the.bell@gmail.com>
CommitDate: Mon Dec 29 13:44:45 2025 -0700
improve print to console logs when piped to a file
---
source/logger.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/source/logger.cpp b/source/logger.cpp
index 7fac296..630b134 100644
--- a/source/logger.cpp
+++ b/source/logger.cpp
@@ -57,8 +57,13 @@ void Logger_Write(const char * format, ...)
fflush(m_file);
#if PRINT_TO_CONSOLE
- vfprintf(stdout, format, args);
+ va_list args2;
+ va_start(args2, format);
+ vfprintf(stdout, format, args2);
+ fflush(stdout);
+ va_end(args2);
#endif
+ va_end(args);
#endif
}