Permalink
Browse files

Route qDebug() messages to debug.log

  • Loading branch information...
Tranz5 committed Oct 11, 2014
1 parent 66dd15d commit 67ccad9820c6fc0a708c6972e917e1e7882b0a6e
Showing with 20 additions and 0 deletions.
  1. +20 −0 src/qt/bitcoin.cpp
View
@@ -114,6 +114,19 @@ static void handleRunawayException(std::exception *e)
exit(1);
}
/* qDebug() message handler --> debug.log */
#if QT_VERSION < 0x050000
void DebugMessageHandler(QtMsgType type, const char * msg)
{
OutputDebugStringF("%s\n", msg);
}
#else
void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString &msg)
{
OutputDebugStringF("%s\n", qPrintable(msg));
}
#endif
#ifndef BITCOIN_QT_TEST
int main(int argc, char *argv[])
{
@@ -209,6 +222,13 @@ 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
QSplashScreen splash(QPixmap(":/images/splash"), 0);
if (GetBoolArg("-splash", true) && !GetBoolArg("-min"))
{

0 comments on commit 67ccad9

Please sign in to comment.