Added code to route Qt GUI/Core messages to message log.
This commit is contained in:
parent
adc08cfd1d
commit
7ccfd43a98
|
@ -32,24 +32,31 @@ static void MessageOutput(QtMsgType type, const QMessageLogContext &context, con
|
||||||
QByteArray localMsg = msg.toLocal8Bit();
|
QByteArray localMsg = msg.toLocal8Bit();
|
||||||
const char *file = context.file ? context.file : "";
|
const char *file = context.file ? context.file : "";
|
||||||
const char *function = context.function ? context.function : "";
|
const char *function = context.function ? context.function : "";
|
||||||
|
char cmsg[2048];
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case QtDebugMsg:
|
case QtDebugMsg:
|
||||||
fprintf(stderr, "Qt Debug: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);
|
sprintf( cmsg, "Qt Debug: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);
|
||||||
|
FCEUD_Message(cmsg);
|
||||||
break;
|
break;
|
||||||
case QtInfoMsg:
|
case QtInfoMsg:
|
||||||
fprintf(stderr, "Qt Info: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);
|
sprintf( cmsg, "Qt Info: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);
|
||||||
|
FCEUD_Message(cmsg);
|
||||||
break;
|
break;
|
||||||
case QtWarningMsg:
|
case QtWarningMsg:
|
||||||
fprintf(stderr, "Qt Warning: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);
|
sprintf( cmsg, "Qt Warning: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);
|
||||||
|
FCEUD_PrintError(cmsg);
|
||||||
break;
|
break;
|
||||||
case QtCriticalMsg:
|
case QtCriticalMsg:
|
||||||
fprintf(stderr, "Qt Critical: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);
|
sprintf( cmsg, "Qt Critical: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);
|
||||||
|
FCEUD_PrintError(cmsg);
|
||||||
break;
|
break;
|
||||||
case QtFatalMsg:
|
case QtFatalMsg:
|
||||||
fprintf(stderr, "Qt Fatal: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);
|
sprintf( cmsg, "Qt Fatal: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function);
|
||||||
|
FCEUD_PrintError(cmsg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
fprintf(stderr, "%s", cmsg );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue