Skip to content

Commit

Permalink
Log: Flush on every write
Browse files Browse the repository at this point in the history
Slower, but if we crash, need the whole thing.
  • Loading branch information
stenzek committed Aug 18, 2024
1 parent ce7bbb4 commit 44a12db
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/common/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ void Log::FileOutputLogCallback(void* pUserParam, const char* channelName, const

FormatLogMessageAndPrint(channelName, functionName, level, message, true, false, true, [](std::string_view message) {
std::fwrite(message.data(), 1, message.size(), s_file_handle.get());
std::fflush(s_file_handle.get());
});
}

Expand Down

0 comments on commit 44a12db

Please sign in to comment.