Use a different timestamp methode
This commit is contained in:
parent
cebd73c094
commit
4fc6e33cd4
|
@ -19,7 +19,7 @@
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDateTime>
|
#include <QTime>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
|
@ -65,19 +65,16 @@ SnoreLog::SnoreLog(SnoreDebugLevels lvl):
|
||||||
|
|
||||||
SnoreLog::~SnoreLog()
|
SnoreLog::~SnoreLog()
|
||||||
{
|
{
|
||||||
std::wstringstream sstream;
|
QByteArray message = QTime::currentTime().toString(QLatin1String("hh:mm:ss: ")).toUtf8().constData();
|
||||||
sstream << QDateTime::currentDateTime().toString(QLatin1String("hh:mm:ss")).toUtf8().constData()
|
message.append(m_msg.toUtf8().constData());
|
||||||
<< ": " << m_msg.toUtf8().constData();
|
|
||||||
|
|
||||||
std::wstring message = sstream.str();
|
|
||||||
if (logFile) {
|
if (logFile) {
|
||||||
*logFile << message.c_str() << "\n";
|
*logFile << message.constData() << "\n";
|
||||||
logFile->flush();
|
logFile->flush();
|
||||||
}
|
}
|
||||||
if (m_lvl == SNORE_WARNING) {
|
if (m_lvl == SNORE_WARNING) {
|
||||||
std::wcerr << message << std::endl;
|
std::wcerr << message.constData() << std::endl;
|
||||||
} else if (debugLevel >= m_lvl) {
|
} else if (debugLevel >= m_lvl) {
|
||||||
std::wcout << message << std::endl;
|
std::wcout << message.constData() << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue