From 8a648ebb64c0474c92a9a13b478b0b7cdd2cea02 Mon Sep 17 00:00:00 2001 From: skyjake Date: Mon, 21 May 2012 13:29:50 +0300 Subject: [PATCH] Debug: Flush log buffer immediately after printing a message Slows things down a little, but makes sure the messages are in the log in case of a crash. --- doomsday/engine/portable/src/con_main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doomsday/engine/portable/src/con_main.c b/doomsday/engine/portable/src/con_main.c index 766a309411..1971f625b5 100644 --- a/doomsday/engine/portable/src/con_main.c +++ b/doomsday/engine/portable/src/con_main.c @@ -1886,6 +1886,9 @@ static void conPrintf(int flags, const char* format, va_list args) if(consoleDump) { LegacyCore_PrintLogFragment(de2LegacyCore, prbuff); +#ifdef _DEBUG + LogBuffer_Flush(); +#endif } } @@ -2021,6 +2024,9 @@ void Con_Message(const char *message, ...) { //printf("%s", buffer); LegacyCore_PrintLogFragment(de2LegacyCore, buffer); +#ifdef _DEBUG + LogBuffer_Flush(); +#endif } // Also print in the console.