From ea50f6fdefc5968cafd68a7db7d49af5aefbd5b6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 30 Sep 2016 14:55:59 +0200 Subject: msg: flush after every message for --log-file We'd like to get log messages on the output as soon as possible in the output. I also feel like using fflush() is nicer than using setvbuf(). Who knows how the latter behaves on win32. --- common/msg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/common/msg.c b/common/msg.c index 4029698888..6d70f88db3 100644 --- a/common/msg.c +++ b/common/msg.c @@ -289,6 +289,7 @@ static void write_log_file(struct mp_log *log, int lev, char *text) (mp_time_us() - MP_START_TIME) / 1e6, mp_log_levels[lev][0], log->verbose_prefix, text); + fflush(root->log_file); } static void write_msg_to_buffers(struct mp_log *log, int lev, char *text) -- cgit v1.2.3