diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-06-27 21:35:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-06-27 21:35:16 +0300 |
commit | 34f6df585176b38e8cd6744b2b1f7c03aa1d2dd6 (patch) | |
tree | 4478bb8ce6cd700c4169ea73babb86f5616ed89c /src/logger.cpp | |
parent | 6c8cc8cdf6286e19f2af1f994e19604ba01a9af3 (diff) | |
download | ManaVerse-34f6df585176b38e8cd6744b2b1f7c03aa1d2dd6.tar.gz ManaVerse-34f6df585176b38e8cd6744b2b1f7c03aa1d2dd6.tar.bz2 ManaVerse-34f6df585176b38e8cd6744b2b1f7c03aa1d2dd6.tar.xz ManaVerse-34f6df585176b38e8cd6744b2b1f7c03aa1d2dd6.zip |
Fix flushing log data from non main thread.
Before it was buffered before any logging data from main thread.
Diffstat (limited to 'src/logger.cpp')
-rw-r--r-- | src/logger.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/logger.cpp b/src/logger.cpp index 48578c20d..9e8e1be3e 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -336,7 +336,7 @@ void Logger::log_r(const char *const log_text, ...) if (mLogFile.is_open()) { - timeStr << buf << std::endl; + timeStr << buf; mThreadLocked = true; mDelayedLog.push_back(timeStr.str()); mThreadLocked = false; @@ -357,7 +357,7 @@ void Logger::flush() { SDL_mutexP(mMutex); FOR_EACH (std::vector<std::string>::const_iterator, it, mDelayedLog) - mLogFile << *it; + mLogFile << *it << std::endl; mDelayedLog.clear(); SDL_mutexV(mMutex); } |