diff options
author | Kai Koehne <kai.koehne@qt.io> | 2018-01-30 14:52:14 +0100 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2018-04-25 11:02:53 +0000 |
commit | 7917305aa5acdad117632bc2723d9bec85daa0e0 (patch) | |
tree | 28dd6554c99e22d4e222bb858ad9d1317d5ac211 /src/corelib/io/qloggingcategory.cpp | |
parent | b1bbce26098012f10d18362d53fdf7ced7dbbf8c (diff) |
Doc: Show more examples on how to have multiple logging rules
Task-number: QTBUG-66050
Change-Id: I6872cd64f9b27b9849e4166af7aa6414c372cd5e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/corelib/io/qloggingcategory.cpp')
-rw-r--r-- | src/corelib/io/qloggingcategory.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp index b029274329..a6c27d19c0 100644 --- a/src/corelib/io/qloggingcategory.cpp +++ b/src/corelib/io/qloggingcategory.cpp @@ -147,9 +147,15 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift) Rules are evaluated in text order, from first to last. That is, if two rules apply to a category/type, the rule that comes later is applied. - Rules can be set via \l setFilterRules(). Since Qt 5.3, logging rules can also - be set in the \c QT_LOGGING_RULES environment variable, and - are automatically loaded from the \c [Rules] section of a logging + Rules can be set via \l setFilterRules(): + + \code + QLoggingCategory::setFilterRules("*.debug=false\n" + "driver.usb.debug=true"); + \endcode + + Since Qt 5.3, logging rules are also + automatically loaded from the \c [Rules] section of a logging configuration file. Such configuration files are looked up in the QtProject configuration directory, or explicitly set in a \c QT_LOGGING_CONF environment variable: @@ -160,19 +166,18 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift) driver.usb.debug=true \endcode - Rules set by \l setFilterRules() take precedence over rules specified - in the QtProject configuration directory, and can, in turn, be - overwritten by rules from the configuration file specified by - \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: + Since Qt 5.3, logging rules can also be specified in a \c QT_LOGGING_RULES + environment variable. And since Qt 5.6, multiple rules can also be + separated by semicolons: \code QT_LOGGING_RULES="*.debug=false;driver.usb.debug=true" \endcode + Rules set by \l setFilterRules() take precedence over rules specified + in the QtProject configuration directory, and can, in turn, be + overwritten by rules from the configuration file specified by + \c QT_LOGGING_CONF, and rules set by \c QT_LOGGING_RULES. Order of evaluation: \list |