Skip to content

Commit

Permalink
Do not use Qt's debugging information in the log handler.
Browse files Browse the repository at this point in the history
* This information is not always available and caused crashes
    in some builds.
  • Loading branch information
philmb3487 authored and CaveSpectre11 committed Apr 17, 2020
1 parent e55e708 commit 5416ae0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/qt/veil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,19 @@ static void initTranslations(QTranslator &qtTranslatorBase, QTranslator &qtTrans
/* qDebug() message handler --> debug.log */
void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString &msg)
{
#ifndef QT_MESSAGELOGCONTEXT
Q_UNUSED(context);
//#ifndef QT_MESSAGELOGCONTEXT
// ^ Do not use this except in debugging environments as some OSs don't handle it properly

Q_UNUSED(context);
if (type == QtDebugMsg) {
LogPrint(BCLog::QT, "GUI: %s\n", msg.toStdString());
} else {
LogPrintf("GUI: %s\n", msg.toStdString());
}
#else // QT_MESSAGELOGCONTEXT needs to be added to the DEFS line of the Makefile
LogPrintf("GUI: %s:%d %s\n", context.file, context.line, msg.toStdString());
#endif

//#else // QT_MESSAGELOGCONTEXT needs to be added to the DEFS line of the Makefile
// LogPrintf("GUI: %s:%d %s\n", context.file, context.line, msg.toStdString());
//#endif
}

/** Class encapsulating Bitcoin Core startup and shutdown.
Expand Down

0 comments on commit 5416ae0

Please sign in to comment.