mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-06 11:10:44 +00:00
add a verbose logging option and format the logs
This commit is contained in:
parent
5d010d653b
commit
894f042688
@ -23,23 +23,26 @@ void MyOutputHandler(QtMsgType type, const QMessageLogContext &context, const QS
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString msg, typestr;
|
QString msg, typestr, contextstr;
|
||||||
|
#ifdef VERBOSE_LOGGING
|
||||||
|
contextstr = QString(context.file) + " " + context.function + ":" + QString::number(context.line) + " ";
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case QtWarningMsg:
|
case QtWarningMsg:
|
||||||
typestr = QString("Warning: ");
|
typestr = QString("Warning: ") + contextstr;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QtFatalMsg:
|
case QtFatalMsg:
|
||||||
typestr = QString("Fatal: ");
|
typestr = QString("Fatal: ") + contextstr;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QtCriticalMsg:
|
case QtCriticalMsg:
|
||||||
typestr = QString("Critical: ");
|
typestr = QString("Critical: ") + contextstr;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
typestr = QString("Debug: ");
|
typestr = QString("Debug: ") + contextstr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user