Logging: Change 'rules' section name to 'Rules'
This is more consistent with e.g. qt.conf, where section names also start with an upper case character. Change-Id: I9ddaf72baeb9334d081807412512242d5d46cbbf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>bb10
parent
5ce87f0782
commit
f3ed93e486
|
|
@ -109,7 +109,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QLoggingCategory, qtDefaultCategory,
|
|||
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
|
||||
are also automatically loaded from the \c [rules] section of a logging
|
||||
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.
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ void QLoggingSettingsParser::setContent(QTextStream &stream)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (_section == QLatin1String("rules")) {
|
||||
if (_section == QLatin1String("Rules")) {
|
||||
int equalPos = line.indexOf(QLatin1Char('='));
|
||||
if ((equalPos != -1)
|
||||
&& (line.lastIndexOf(QLatin1Char('=')) == equalPos)) {
|
||||
|
|
@ -298,7 +298,7 @@ void QLoggingRegistry::unregisterCategory(QLoggingCategory *cat)
|
|||
void QLoggingRegistry::setApiRules(const QString &content)
|
||||
{
|
||||
QLoggingSettingsParser parser;
|
||||
parser.setSection(QStringLiteral("rules"));
|
||||
parser.setSection(QStringLiteral("Rules"));
|
||||
parser.setContent(content);
|
||||
|
||||
QMutexLocker locker(®istryMutex);
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
[rules]
|
||||
[Rules]
|
||||
*=true
|
||||
|
|
|
|||
|
|
@ -63,16 +63,16 @@ private slots:
|
|||
{
|
||||
//
|
||||
// Logging configuration can be described
|
||||
// in an .ini file. [rules] is the
|
||||
// in an .ini file. [Rules] is the
|
||||
// default category, and optional ...
|
||||
//
|
||||
QLoggingSettingsParser parser;
|
||||
parser.setContent("[rules]\n"
|
||||
parser.setContent("[Rules]\n"
|
||||
"default=false\n"
|
||||
"default=true");
|
||||
QCOMPARE(parser.rules().size(), 2);
|
||||
|
||||
parser.setContent("[rules]\n"
|
||||
parser.setContent("[Rules]\n"
|
||||
"default=false");
|
||||
QCOMPARE(parser.rules().size(), 1);
|
||||
|
||||
|
|
@ -115,7 +115,7 @@ private slots:
|
|||
QFile file(dir.absoluteFilePath("qtlogging.ini"));
|
||||
QVERIFY(file.open(QFile::WriteOnly | QFile::Text));
|
||||
QTextStream out(&file);
|
||||
out << "[rules]\n";
|
||||
out << "[Rules]\n";
|
||||
out << "Digia.*=false\n";
|
||||
file.close();
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ private slots:
|
|||
|
||||
// set Config rule
|
||||
QLoggingSettingsParser parser;
|
||||
parser.setContent("[rules]\nDigia.*=false");
|
||||
parser.setContent("[Rules]\nDigia.*=false");
|
||||
registry->configRules=parser.rules();
|
||||
registry->updateRules();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue