Skip to content

Commit

Permalink
Improve flushing for un-managed fp such as stdout; upgrade fmt to 8.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Rao Meng committed Jul 6, 2021
1 parent a44cbed commit cb3799c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fmt
5 changes: 4 additions & 1 deletion fmtlog-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ class fmtlogDetailT
}

void flushLogFile() {
if (outputFp) fwrite(membuf.data(), 1, membuf.size(), outputFp);
if (outputFp) {
fwrite(membuf.data(), 1, membuf.size(), outputFp);
if (!manageFp) fflush(outputFp);
}
membuf.clear();
nextFlushTime = (std::numeric_limits<int64_t>::max)();
}
Expand Down

0 comments on commit cb3799c

Please sign in to comment.