diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-02-16 02:34:40 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-02-16 02:34:40 +0300 |
commit | 9b3e17bbce13963d61008d7ab73d3d959725c305 (patch) | |
tree | f40d8987605b1ae4e5adf8ee879cf5bed09d9961 /src | |
parent | 1e68125a911d426df22281690f09396158ba5ded (diff) | |
download | manaverse-9b3e17bbce13963d61008d7ab73d3d959725c305.tar.gz manaverse-9b3e17bbce13963d61008d7ab73d3d959725c305.tar.bz2 manaverse-9b3e17bbce13963d61008d7ab73d3d959725c305.tar.xz manaverse-9b3e17bbce13963d61008d7ab73d3d959725c305.zip |
Add flush in logger for improve log saving.
Diffstat (limited to 'src')
-rw-r--r-- | src/logger.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/logger.cpp b/src/logger.cpp index f068d5b52..4758fa026 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -204,6 +204,7 @@ void Logger::dlog2(const std::string &str, pos, str.c_str()); } + fflush(mLogFile); } if (mLogToStandardOut) @@ -248,6 +249,7 @@ void Logger::log1(const char *const buf) "%s %s\n", timeStr.c_str(), buf); + fflush(mLogFile); } if (mLogToStandardOut) @@ -291,6 +293,7 @@ void Logger::log(const char *const log_text, ...) "%s %s\n", timeStr.c_str(), buf); + fflush(mLogFile); } if (mLogToStandardOut) @@ -337,6 +340,7 @@ void Logger::assertLog(const char *const log_text, ...) "%s %s\n", timeStr.c_str(), buf); + fflush(mLogFile); } if (mLogToStandardOut) @@ -416,6 +420,7 @@ void Logger::flush() fputs((*it).c_str(), mLogFile); fputs("\n", mLogFile); } + fflush(mLogFile); mDelayedLog.clear(); SDL_mutexV(mMutex); } |