diff --git a/src/util/logging.cpp b/src/util/logging.cpp index 49d95445de5..c682cd80d30 100644 --- a/src/util/logging.cpp +++ b/src/util/logging.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include #include @@ -121,6 +122,8 @@ inline QString formatLogFileMessage( QtMsgType type, const QString& message, const QString& threadName) { + QString timestamp = QDateTime::currentDateTime().toString("hh:mm:ss.zzz"); + QString levelName; switch (type) { case QtDebugMsg: @@ -140,7 +143,7 @@ inline QString formatLogFileMessage( break; } - return levelName + QStringLiteral(" [") + threadName + QStringLiteral("] ") + message; + return QStringLiteral("%1 %2 [%3] %4").arg(timestamp, levelName, threadName, message); } /// Actually write a log message to a file.