summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qlogging.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/global/qlogging.cpp')
-rw-r--r--src/corelib/global/qlogging.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 64dd544cf0..8c1d8b867d 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -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;
@@ -1220,7 +1225,7 @@ static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &con
logMessage.chop(1);
systemd_default_message_handler(type, context, logMessage);
} else {
- fprintf(stderr, "%s", logMessage.toUtf8().constData());
+ fprintf(stderr, "%s", logMessage.toLocal8Bit().constData());
fflush(stderr);
}
#elif defined(Q_OS_ANDROID)
@@ -1479,12 +1484,15 @@ void qErrnoWarning(int code, const char *msg, ...)
\c %{if-warning}, \c %{if-critical} or \c %{if-fatal} followed by an \c %{endif}.
What is inside the \c %{if-*} and \c %{endif} will only be printed if the type matches.
+ Finally, text inside \c %{if-category} ... \c %{endif} is only printed if the category
+ is not the default one.
+
Example:
\code
QT_MESSAGE_PATTERN="[%{if-debug}D%{endif}%{if-warning}W%{endif}%{if-critical}C%{endif}%{if-fatal}F%{endif}] %{file}:%{line} - %{message}"
\endcode
- The default \a pattern is "%{message}".
+ The default \a pattern is "%{if-category}%{category}: %{endif}%{message}".
The \a pattern can also be changed at runtime by setting the QT_MESSAGE_PATTERN
environment variable; if both qSetMessagePattern() is called and QT_MESSAGE_PATTERN is