Skip to content

Commit 88eaba5

Browse files
committed
Format log timestamp with brackets in message_handler()
1 parent 2dae85f commit 88eaba5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ void message_handler(QtMsgType type, const QMessageLogContext &context, const QS
66
QFile log_file("qInfo.log");
77
if (log_file.open(QIODevice::WriteOnly | QIODevice::Append)) {
88
QTextStream stream(&log_file);
9-
QString t_msg = QDateTime::currentDateTime().toString() + " : " + msg;
9+
QString t_msg = "[" + QDateTime::currentDateTime().toString() + "] : " + msg;
1010
stream << t_msg << Qt::endl;
1111
}
1212
}

0 commit comments

Comments
 (0)