diff --git a/src/utils/setup.cpp b/src/utils/setup.cpp index 95c7e59..a5ea435 100644 --- a/src/utils/setup.cpp +++ b/src/utils/setup.cpp @@ -7,28 +7,27 @@ void mainQtMessageHandler( QtMsgType type, const QMessageLogContext& context, const QString& msg ) { + // context contains null pointers on release builds. Cast to get rid of + // unreferenced formal parameter warnings. + static_cast( context ); + QByteArray localMsg = msg.toLocal8Bit(); switch ( type ) { case QtDebugMsg: - LOG( DEBUG ) << localMsg.constData() << " (" << context.file << ":" - << context.line << ")"; + LOG( DEBUG ) << localMsg.constData(); break; case QtInfoMsg: - LOG( INFO ) << localMsg.constData() << " (" << context.file << ":" - << context.line << ")"; + LOG( INFO ) << localMsg.constData(); break; case QtWarningMsg: - LOG( WARNING ) << localMsg.constData() << " (" << context.file << ":" - << context.line << ")"; + LOG( WARNING ) << localMsg.constData(); break; case QtCriticalMsg: - LOG( ERROR ) << localMsg.constData() << " (" << context.file << ":" - << context.line << ")"; + LOG( ERROR ) << localMsg.constData(); break; case QtFatalMsg: - LOG( FATAL ) << localMsg.constData() << " (" << context.file << ":" - << context.line << ")"; + LOG( FATAL ) << localMsg.constData(); break; } }