summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2019-04-23 15:20:15 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2019-04-25 08:40:37 +0000
commit6a03d300be399a09de6cc02a6e3731b51ed5c6da (patch)
tree39496c96501b47d5d2fa2cfb388b2505cbc675ab /tools
parent05184f2976413403cf68b777dc4960761c7535f2 (diff)
qml runtime tool: --quiet disables categorized logging too
[ChangeLog][QtQml][qml] The QML Runtime tool --quiet option now disables categorized logging in addition to qDebug, qInfo, qWarning and qFatal, except for some early QPA-level categorized logging that occurs during application construction. You can still override specific categories by setting QT_LOGGING_CONF or QT_LOGGING_RULES. Change-Id: Icf986a7fa9980d07beed308df8f69fcc4da9d771 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tools')
-rw-r--r--tools/qml/main.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index e70dcb7fa7..1d520b8fde 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -49,6 +49,7 @@
#include <QDir>
#include <QFile>
#include <QFileInfo>
+#include <QLoggingCategory>
#include <QStringList>
#include <QScopedPointer>
#include <QDebug>
@@ -304,8 +305,8 @@ void quietMessageHandler(QtMsgType type, const QMessageLogContext &ctxt, const Q
exit(-1);
case QtCriticalMsg:
case QtDebugMsg:
+ case QtInfoMsg:
case QtWarningMsg:
- default:
;
}
}
@@ -551,8 +552,10 @@ int main(int argc, char *argv[])
printf("qml: Translation file specified, but Qt built without translation support.\n");
#endif
- if (quietMode)
+ if (quietMode) {
qInstallMessageHandler(quietMessageHandler);
+ QLoggingCategory::setFilterRules(QStringLiteral("*=false"));
+ }
if (files.count() <= 0) {
#if defined(Q_OS_DARWIN)