Merge pull request #11593 from Eism/backend_logging_fix_mu2

[MU2] Backend log fix
This commit is contained in:
Elnur Ismailzada 2022-05-11 10:58:48 +03:00 committed by GitHub
commit ce0d9e0290
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 22 deletions

View File

@ -3161,28 +3161,10 @@ static bool processNonGui(const QStringList& argv)
// Message handler
//---------------------------------------------------------
#if defined(QT_DEBUG) && defined(Q_OS_WIN)
static void mscoreMessageHandler(QtMsgType type, const QMessageLogContext &context,const QString &msg)
static void mscoreMessageHandler(QtMsgType, const QMessageLogContext&,const QString&)
{
QTextStream cerr(stderr);
QByteArray localMsg = msg.toLocal8Bit();
switch (type) {
case QtDebugMsg:
cerr << "Debug: " << localMsg.constData() << " (" << context.file << ":" << context.line << ", " << context.function << ")" << endl;
break;
case QtWarningMsg:
cerr << "Warning: " << localMsg.constData() << " (" << context.file << ":" << context.line << ", " << context.function << ")" << endl;
break;
case QtCriticalMsg:
cerr << "Critical: " << localMsg.constData() << " (" << context.file << ":" << context.line << ", " << context.function << ")" << endl;
break;
case QtFatalMsg: // set your breakpoint here, if you want to catch the abort
cerr << "Fatal: " << localMsg.constData() << " (" << context.file << ":" << context.line << ", " << context.function << ")" << endl;
abort();
}
//! NOTE: disabled for backend
}
#endif
//---------------------------------------------------------
// synthesizerFactory
@ -6134,9 +6116,7 @@ using namespace Ms;
int main(int argc, char* av[])
{
QApplication::setDesktopSettingsAware(true);
#if defined(QT_DEBUG) && defined(Q_OS_WIN)
qInstallMessageHandler(mscoreMessageHandler);
#endif
QFile f(":/revision.h");
f.open(QIODevice::ReadOnly);