From d2f37c8202f9097f0ffaacdc6f08d05a9b7a15e9 Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Wed, 9 May 2018 13:10:05 -0500 Subject: [PATCH] ENT-3756: try to flush each line of logging while in debug level --- libutils/logging.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libutils/logging.c b/libutils/logging.c index 3f5a1f838d..2d0aa78a75 100644 --- a/libutils/logging.c +++ b/libutils/logging.c @@ -175,6 +175,12 @@ static void LogToConsole(const char *msg, LogLevel level, bool color) fprintf(stdout, "%8s: %s\n", LogLevelToString(level), msg); + if (level == LOG_LEVEL_DEBUG) + { + fflush(stdout); + // TODO also possibly call sync()? Not sure if that's too "expensive" or not. + } + if (color) { // Turn off the color again.