From 8f814e8cba3b52bdf3fff933e9dc5db5c97b30e8 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Fri, 10 Jul 2015 14:56:00 +0900 Subject: [PATCH] QT_LOGGING_RULES supports multiple rules separated by semicolons [ChangeLog][QtCore][Logging] QT_LOGGING_RULES now supports multiple rules separated by semicolons Change-Id: I7fdd62a3d719aeb16cad54f193befb6c203bc160 Reviewed-by: Kai Koehne Reviewed-by: Martin Smith --- src/corelib/io/qloggingcategory.cpp | 8 ++++++++ src/corelib/io/qloggingregistry.cpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp index e6bc7caaebc..1d06e2a912d 100644 --- a/src/corelib/io/qloggingcategory.cpp +++ b/src/corelib/io/qloggingcategory.cpp @@ -147,6 +147,14 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift) \c QT_LOGGING_CONF, and rules set by \c QT_LOGGING_RULES. + Since Qt 5.6, \c QT_LOGGING_RULES may contain multiple rules separated + by semicolons: + + \code + QT_LOGGING_RULES="*.debug=false;driver.usb.debug=true" + \endcode + + Order of evaluation: \list \li QtProject/qtlogging.ini diff --git a/src/corelib/io/qloggingregistry.cpp b/src/corelib/io/qloggingregistry.cpp index 7f2ce319eea..85e73db652b 100644 --- a/src/corelib/io/qloggingregistry.cpp +++ b/src/corelib/io/qloggingregistry.cpp @@ -265,7 +265,7 @@ void QLoggingRegistry::init() envRules = parser.rules(); } } - const QByteArray rulesSrc = qgetenv("QT_LOGGING_RULES"); + const QByteArray rulesSrc = qgetenv("QT_LOGGING_RULES").replace(';', '\n'); if (!rulesSrc.isEmpty()) { QTextStream stream(rulesSrc); QLoggingSettingsParser parser;