diff --git a/src/main.cpp b/src/main.cpp index 6c32f49ca..e496c23a9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1771,9 +1771,8 @@ int main(int argc, char *argv[] ) race_manager->setupPlayerKartInfo(); race_manager->startNew(false); main_loop->run(); - // well, actually run() will never return, since - // it exits after replaying history (see history::GetNextDT()). - // So the next line is just to make this obvious here! + // The run() function will only return if the user aborts. + Log::flushBuffers(); exit(-3); } diff --git a/src/utils/log.cpp b/src/utils/log.cpp index b349bb9e7..8a84db47b 100644 --- a/src/utils/log.cpp +++ b/src/utils/log.cpp @@ -189,8 +189,9 @@ void Log::writeLine(const char *line, int level) { // If we don't have a console file, write to stdout and hope for the best - if (!m_file_stdout || level >= LL_WARN || - UserConfigParams::m_log_errors_to_console) // log to console & file + if ( m_buffer_size <= 1 && + (!m_file_stdout || level >= LL_WARN || + UserConfigParams::m_log_errors_to_console) ) // log to console { setTerminalColor((LogLevel)level); #ifdef ANDROID @@ -218,7 +219,7 @@ void Log::writeLine(const char *line, int level) } #if defined(_MSC_FULL_VER) && defined(_DEBUG) - OutputDebugString(line); + if (m_buffer_size <= 1) OutputDebugString(line); #endif if (m_file_stdout) fprintf(m_file_stdout, "%s", line);