From cebd73c09466f7863f04a5198a9f1df04a578ccc Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Sat, 15 Aug 2015 00:46:45 +0200 Subject: [PATCH] Fix flushing --- src/libsnore/log.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libsnore/log.cpp b/src/libsnore/log.cpp index b696e3c..182bee7 100644 --- a/src/libsnore/log.cpp +++ b/src/libsnore/log.cpp @@ -66,18 +66,18 @@ SnoreLog::SnoreLog(SnoreDebugLevels lvl): SnoreLog::~SnoreLog() { std::wstringstream sstream; - sstream << QDateTime::currentDateTime().toString(QLatin1String("hh:mm:ss")).toLocal8Bit().constData() - << ": " << m_msg.toLocal8Bit().constData() << std::endl; + sstream << QDateTime::currentDateTime().toString(QLatin1String("hh:mm:ss")).toUtf8().constData() + << ": " << m_msg.toUtf8().constData(); std::wstring message = sstream.str(); if (logFile) { - *logFile << message.c_str(); + *logFile << message.c_str() << "\n"; logFile->flush(); } if (m_lvl == SNORE_WARNING) { - std::wcerr << message; + std::wcerr << message << std::endl; } else if (debugLevel >= m_lvl) { - std::wcout << message; + std::wcout << message << std::endl; } }