aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-09-02 04:21:19 -0700
committerWladimir J. van der Laan <laanwj@gmail.com>2013-09-02 04:21:19 -0700
commit2534d05c63b414e1175b5f1a6ec2e429059f9464 (patch)
treec8bd19008b66dce6b2503a558c7b4a0a8c9237ac
parentf19eda1d5735c90ad76faa13186791f3033e67b3 (diff)
parente664c3d70cf5f1db134094a728b15d09146e9a6e (diff)
Merge pull request #2963 from Diapolo/log-qt
Bitcoin-Qt: allow to differentiate Qt log entries from core
-rw-r--r--src/qt/bitcoin.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index f2386f3cff..a4d589e167 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -155,12 +155,12 @@ static void initTranslations(QTranslator &qtTranslatorBase, QTranslator &qtTrans
#if QT_VERSION < 0x050000
void DebugMessageHandler(QtMsgType type, const char * msg)
{
- OutputDebugStringF("%s\n", msg);
+ OutputDebugStringF("Bitcoin-Qt: %s\n", msg);
}
#else
void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString &msg)
{
- OutputDebugStringF("%s\n", qPrintable(msg));
+ OutputDebugStringF("Bitcoin-Qt: %s\n", qPrintable(msg));
}
#endif
@@ -236,6 +236,12 @@ int main(int argc, char *argv[])
// Install global event filter that makes sure that long tooltips can be word-wrapped
app.installEventFilter(new GUIUtil::ToolTipToRichTextFilter(TOOLTIP_WRAP_THRESHOLD, &app));
+ // Install qDebug() message handler to route to debug.log
+#if QT_VERSION < 0x050000
+ qInstallMsgHandler(DebugMessageHandler);
+#else
+ qInstallMessageHandler(DebugMessageHandler);
+#endif
// ... now GUI settings:
OptionsModel optionsModel;
@@ -255,13 +261,6 @@ int main(int argc, char *argv[])
return 1;
}
- // Install qDebug() message handler to route to debug.log:
-#if QT_VERSION < 0x050000
- qInstallMsgHandler(DebugMessageHandler);
-#else
- qInstallMessageHandler(DebugMessageHandler);
-#endif
-
SplashScreen splash(QPixmap(), 0);
if (GetBoolArg("-splash", true) && !GetBoolArg("-min", false))
{