summaryrefslogtreecommitdiffstats
path: root/examples/logger/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/logger/main.cpp')
-rw-r--r--examples/logger/main.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/logger/main.cpp b/examples/logger/main.cpp
index c82c02c..0ca78a9 100644
--- a/examples/logger/main.cpp
+++ b/examples/logger/main.cpp
@@ -74,9 +74,9 @@ static void myCustomMessageHandler(QtMsgType type, const QMessageLogContext &con
QFile outFile(LOGOUTPUTFILE);
if (outFile.open(QIODevice::WriteOnly | QIODevice::Append)) {
QByteArray message;
-// message.append("<");
-// message.append(context.category);
-// message.append(">");
+ message.append("<");
+ message.append(context.category);
+ message.append(">");
message.append(msg);
message.append('\n');
@@ -133,8 +133,7 @@ int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
-// qputenv ("QT_MESSAGE_PATTERN", QString("%{category}: %{type},%{message}").toLatin1());
- qputenv ("QT_MESSAGE_PATTERN", QString("%{type} %{message}").toLatin1());
+ qputenv ("QT_MESSAGE_PATTERN", QString("%{category}: %{type},%{message}").toLatin1());
oldMessageHandler = qInstallMessageHandler(myCustomMessageHandler);
//delete old logoutput file