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 <kai.koehne@theqtcompany.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
This commit is contained in:
Tasuku Suzuki 2015-07-10 14:56:00 +09:00 committed by Tasuku Suzuki (PTP)
parent 287971eb7f
commit 8f814e8cba
2 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -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;