Commit 6521cb8 1 parent 2181a66 commit 6521cb8 Copy full SHA for 6521cb8
File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 6
6
7
7
#include < init.h>
8
8
#include < interfaces/node.h>
9
+ #include < logging.h>
9
10
#include < node/context.h>
10
11
#include < node/ui_interface.h>
11
12
#include < noui.h>
25
26
#include < QQmlApplicationEngine>
26
27
#include < QQmlContext>
27
28
#include < QQuickWindow>
29
+ #include < QString>
28
30
#include < QStringLiteral>
29
31
#include < QUrl>
30
32
33
+ QT_BEGIN_NAMESPACE
34
+ class QMessageLogContext ;
35
+ QT_END_NAMESPACE
36
+
31
37
#if defined(QT_STATICPLUGIN)
32
38
#include < QtPlugin>
33
39
Q_IMPORT_PLUGIN (QtQuick2DialogsPlugin);
@@ -61,6 +67,17 @@ bool InitErrorMessageBox(
61
67
qGuiApp->exec ();
62
68
return false ;
63
69
}
70
+
71
+ /* qDebug() message handler --> debug.log */
72
+ void DebugMessageHandler (QtMsgType type, const QMessageLogContext& context, const QString& msg)
73
+ {
74
+ Q_UNUSED (context);
75
+ if (type == QtDebugMsg) {
76
+ LogPrint (BCLog::QT, " GUI: %s\n " , msg.toStdString ());
77
+ } else {
78
+ LogPrintf (" GUI: %s\n " , msg.toStdString ());
79
+ }
80
+ }
64
81
} // namespace
65
82
66
83
@@ -154,6 +171,9 @@ int QmlGuiMain(int argc, char* argv[])
154
171
return EXIT_FAILURE;
155
172
}
156
173
174
+ // Install qDebug() message handler to route to debug.log
175
+ qInstallMessageHandler (DebugMessageHandler);
176
+
157
177
qInfo () << " Graphics API in use:" << QmlUtil::GraphicsApi (window);
158
178
159
179
return qGuiApp->exec ();
You can’t perform that action at this time.
0 commit comments