Flush stdout output

Apparently when no tty is attached, which is the case for Docker, the
buffer size for stdout increases to the point that only half of the
entire log might be written.
This commit is contained in:
Maxim Biro 2016-01-01 02:46:14 -05:00
parent 5d9e40bbd3
commit c22c06adbe

View File

@ -94,6 +94,7 @@ FILE* level_stdout(LOG_LEVEL level)
void log_stdout(LOG_LEVEL level, const char *format, va_list args) void log_stdout(LOG_LEVEL level, const char *format, va_list args)
{ {
vfprintf(level_stdout(level), format, args); vfprintf(level_stdout(level), format, args);
fflush(level_stdout(level));
} }
bool write_log(LOG_LEVEL level, const char *format, ...) bool write_log(LOG_LEVEL level, const char *format, ...)