From 7ec98134902de9afce51c66e8c252e004f5891b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 7 Feb 2018 12:17:15 +0100 Subject: [PATCH] Fix inverted logic in slog2 log handler for when to disable logging If we are logging to the console, we should _not_ log to slog2, like the other log backends. Change-Id: I6d16704c0f0923f54b3dc030d374af9805c2af06 Reviewed-by: Thiago Macieira --- src/corelib/global/qlogging.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index c727d5738bb..e2d08544a18 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -1324,7 +1324,7 @@ static QString formatBacktraceForLogMessage(const QMessagePattern::BacktracePara static bool slog2_default_handler(QtMsgType type, const QMessageLogContext &context, const QString &message) { - if (!qt_logging_to_console()) + if (qt_logging_to_console()) return false; QString formattedMessage = qFormatLogMessage(type, context, message);