--flush_stdout to disable flushing.

This commit is contained in:
Ben Vanik
2015-03-22 11:49:13 -07:00
parent f8db3774cb
commit 6486299496
2 changed files with 6 additions and 3 deletions

View File

@@ -18,6 +18,7 @@
DEFINE_bool(fast_stdout, false,
"Don't lock around stdout/stderr. May introduce weirdness.");
DEFINE_bool(flush_stdout, true, "Flush stdout after each log line.");
DEFINE_bool(log_filenames, false,
"Log filenames/line numbers in log statements.");
@@ -82,7 +83,9 @@ void log_line(const char* file_path, const uint32_t line_number,
OutputDebugStringA(log_buffer);
#else
fprintf(stdout, "%s", log_buffer);
fflush(stdout);
if (FLAGS_flush_stdout) {
fflush(stdout);
}
#endif // OutputDebugString
if (!FLAGS_fast_stdout) {
log_lock.unlock();