Skip to content

Commit cb3799c

Browse files
author
Rao Meng
committed
Improve flushing for un-managed fp such as stdout; upgrade fmt to 8.0.1
1 parent a44cbed commit cb3799c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

fmtlog-inl.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,10 @@ class fmtlogDetailT
293293
}
294294

295295
void flushLogFile() {
296-
if (outputFp) fwrite(membuf.data(), 1, membuf.size(), outputFp);
296+
if (outputFp) {
297+
fwrite(membuf.data(), 1, membuf.size(), outputFp);
298+
if (!manageFp) fflush(outputFp);
299+
}
297300
membuf.clear();
298301
nextFlushTime = (std::numeric_limits<int64_t>::max)();
299302
}

0 commit comments

Comments
 (0)