Make QtCriticalMsg exit on QT_FATAL_CRITICALS

Change-Id: I92e8f9851dd074f3bcded6981f5545d1e93b549f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Alejandro Exojo 2014-03-07 12:20:30 +01:00 committed by The Qt Project
parent 2e49b7a3b9
commit 6d05f5faff
2 changed files with 7 additions and 0 deletions

View File

@ -3291,6 +3291,8 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
stderr. Under Windows, the message is sent to the debugger.
On Blackberry the message is sent to slogger2.
It exits if the environment variable QT_FATAL_CRITICALS is not empty.
This function takes a format string and a list of arguments,
similar to the C printf() function. The format should be a Latin-1
string.

View File

@ -83,6 +83,11 @@ static bool isFatal(QtMsgType msgType)
if (msgType == QtFatalMsg)
return true;
if (msgType == QtCriticalMsg) {
static bool fatalCriticals = !qEnvironmentVariableIsEmpty("QT_FATAL_CRITICALS");
return fatalCriticals;
}
if (msgType == QtWarningMsg || msgType == QtCriticalMsg) {
static bool fatalWarnings = !qEnvironmentVariableIsEmpty("QT_FATAL_WARNINGS");
return fatalWarnings;