Skip to content

Commit

Permalink
Flush log output for all log messages with at least info level
Browse files Browse the repository at this point in the history
  • Loading branch information
maxberger authored and r00t- committed Dec 24, 2023
1 parent 7675a10 commit 5188375
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/vzlogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ void print(log_level_t level, const char *format, const char *id, ...) {
fprintf(stream, "%-24s", prefix);
vfprintf(stream, format, args);
fprintf(stream, "\n");
if (level <= log_info) {
// required for some targets where stdout is redirected (e.g. docker)
fflush(stream);
}
m_log.unlock(); // release mutex
}
va_end(args);
Expand Down

0 comments on commit 5188375

Please sign in to comment.