Skip to content

Commit

Permalink
[log] Flush after each message when logging to stderr
Browse files Browse the repository at this point in the history
When logging to stderr from usb-moded systemd service (e.g. due to slightly
different logging format) block buffering is used and causes the messages
to appear out of sync vs other processes.

Flush stderr after each diagnostic message.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Jan 28, 2020
1 parent 5389cc8 commit 4e3c8c4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/usb_moded-log.c
Expand Up @@ -279,6 +279,7 @@ void log_emit_va(const char *file, const char *func, int line, int lev, const ch
lineinfo, timeinfo, levelinfo, msg);
#endif
}
fflush(stderr);
break;

default:
Expand Down

0 comments on commit 4e3c8c4

Please sign in to comment.