We need an early timestamp to trace the log message instead of
a timestamp recorded when the message is pushed to the server.
This is important to be able to get proper timestamp when a log
is stalling on user's machine when the remote server is not
running.
#include <QMutexLocker>
#include <QRegExp>
#include <QTextStream>
+#include <QDateTime>
#ifdef WIN32
#include <windows.h>
QFile file ( guiLogFile );
if ( file.open( QFile::Append ) ) // append to log file
{
+ QDateTime current = QDateTime::currentDateTime();
QTextStream stream( &file );
- stream << eventDescription << endl;
+ stream << current.toString("yyyyMMdd-hhmmss") << ": " << eventDescription << endl;
file.close();
}
}