From d949eebc93da6b679cbc765a8b453fe4e6432e21 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sat, 18 Nov 2017 19:24:01 -0500 Subject: [PATCH] Flush logger output --- src/util.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util.cpp b/src/util.cpp index e01c10a9..7417af1f 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -167,6 +167,7 @@ void debug(const char *format, ...) { fprintf(gLogFile, "[debug] "); vfprintf(gLogFile, format, args); fprintf(gLogFile, "\n"); + fflush(gLogFile); va_end(args); } @@ -176,6 +177,7 @@ void info(const char *format, ...) { fprintf(gLogFile, "[info] "); vfprintf(gLogFile, format, args); fprintf(gLogFile, "\n"); + fflush(gLogFile); va_end(args); } @@ -185,6 +187,7 @@ void warn(const char *format, ...) { fprintf(gLogFile, "[warning] "); vfprintf(gLogFile, format, args); fprintf(gLogFile, "\n"); + fflush(gLogFile); va_end(args); } @@ -194,6 +197,7 @@ void fatal(const char *format, ...) { fprintf(gLogFile, "[fatal] "); vfprintf(gLogFile, format, args); fprintf(gLogFile, "\n"); + fflush(gLogFile); va_end(args); }