mirror of
https://github.com/AxioDL/logvisor.git
synced 2025-12-09 05:27:47 +00:00
Always flush log file on close to prevent incomplete logs
This commit is contained in:
@@ -760,6 +760,7 @@ struct FileLogger : public ILogger {
|
|||||||
}
|
}
|
||||||
virtual void closeFile() {
|
virtual void closeFile() {
|
||||||
if (fp) {
|
if (fp) {
|
||||||
|
std::fflush(fp);
|
||||||
std::fclose(fp);
|
std::fclose(fp);
|
||||||
fp = nullptr;
|
fp = nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user