mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-20 20:09:20 +02:00
add time to the interface logs - closes #2205
This commit is contained in:
parent
2e3e699e31
commit
395263ff3d
1 changed files with 5 additions and 3 deletions
|
@ -110,9 +110,11 @@ const QString CUSTOM_URL_SCHEME = "hifi:";
|
||||||
|
|
||||||
void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message) {
|
void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message) {
|
||||||
if (message.size() > 0) {
|
if (message.size() > 0) {
|
||||||
QString messageWithNewLine = message + "\n";
|
QString dateString = QDateTime::currentDateTime().toTimeSpec(Qt::LocalTime).toString(Qt::ISODate);
|
||||||
fprintf(stdout, "%s", messageWithNewLine.toLocal8Bit().constData());
|
QString formattedMessage = QString("[%1] %2\n").arg(dateString).arg(message);
|
||||||
Application::getInstance()->getLogger()->addMessage(messageWithNewLine.toLocal8Bit().constData());
|
|
||||||
|
fprintf(stdout, "%s", qPrintable(formattedMessage));
|
||||||
|
Application::getInstance()->getLogger()->addMessage(qPrintable(formattedMessage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue