Improve debugging output for QLoggingCategory

Make sure that the source the rules are loaded from is printed before
any syntax errors.

Change-Id: Id7ced1a346dd0d8501eab93ac00e1f432ca6b703
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Kai Koehne 2014-07-21 16:47:32 +02:00 committed by hjk
parent 1f9de90b4e
commit c76a91ebdc

View File

@ -261,12 +261,12 @@ void QLoggingRegistry::init()
if (!rulesFilePath.isEmpty()) {
QFile file(QFile::decodeName(rulesFilePath));
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream stream(&file);
QLoggingSettingsParser parser;
parser.setContent(stream);
if (qtLoggingDebug())
debugMsg("Loading \"%s\" ...",
QDir::toNativeSeparators(file.fileName()).toUtf8().constData());
QTextStream stream(&file);
QLoggingSettingsParser parser;
parser.setContent(stream);
envRules = parser.rules();
}
}
@ -285,12 +285,12 @@ void QLoggingRegistry::init()
if (!envPath.isEmpty()) {
QFile file(envPath);
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream stream(&file);
QLoggingSettingsParser parser;
parser.setContent(stream);
if (qtLoggingDebug())
debugMsg("Loading \"%s\" ...",
QDir::toNativeSeparators(envPath).toUtf8().constData());
QTextStream stream(&file);
QLoggingSettingsParser parser;
parser.setContent(stream);
configRules = parser.rules();
}
}