Permalink
Browse files

flush stderr after a log message appears

We had the problem that the log file appeared empty for a long time due
to file buffers. Thus we call fflush() after every log message so the
log file gets written out to disk quickly
  • Loading branch information...
1 parent c4ac2d3 commit d58fd080caf9e83c0f67135e4e8dd1654401bbde Christian Kruse committed Feb 15, 2014
Showing with 2 additions and 0 deletions.
  1. +2 −0 log.c
View
2 log.c
@@ -58,6 +58,8 @@ void stderr_log_with_level(const char *level_name, int level, const char *fmt, .
vfprintf(stderr, fmt1, ap);
va_end(ap);
+
+ fflush(stderr);
}
}

0 comments on commit d58fd08

Please sign in to comment.