diff options
author | Jarek Kobus <jaroslaw.kobus@theqtcompany.com> | 2015-04-24 13:32:57 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@theqtcompany.com> | 2015-04-24 12:58:49 +0000 |
commit | c522fd5de907fb264e24eed842e28d9ac56bce0c (patch) | |
tree | a2110fe689c40f58ae94f8fc05b59f16436f30f5 /src | |
parent | 2554ccb7ba4ef3103411e38b0c2d5d218217cccd (diff) |
Add more logging categories.
Change-Id: I1c7dabfd16a69ef5a3e5aaa490036de061f1fd13
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/installer/globals.cpp | 19 | ||||
-rw-r--r-- | src/libs/installer/globals.h | 5 | ||||
-rw-r--r-- | src/sdk/commandlineparser.cpp | 2 | ||||
-rw-r--r-- | src/sdk/installerbase.cpp | 17 |
4 files changed, 28 insertions, 15 deletions
diff --git a/src/libs/installer/globals.cpp b/src/libs/installer/globals.cpp index 43e5b4365..b91210640 100644 --- a/src/libs/installer/globals.cpp +++ b/src/libs/installer/globals.cpp @@ -34,22 +34,29 @@ #include "globals.h" const char IFW_COMPONENT_CHECKER[] = "ifw.componentChecker"; +const char IFW_RESOURCES[] = "ifw.resources"; +const char IFW_TRANSLATIONS[] = "ifw.translations"; namespace QInstaller { Q_LOGGING_CATEGORY(lcComponentChecker, IFW_COMPONENT_CHECKER) +Q_LOGGING_CATEGORY(lcResources, IFW_RESOURCES) +Q_LOGGING_CATEGORY(lcTranslations, IFW_TRANSLATIONS) -Q_GLOBAL_STATIC_WITH_ARGS(QRegExp, staticCommaRegExp, (QLatin1String("\\b(,|, )\\b"))); -QRegExp commaRegExp() +QStringList loggingCategories() { - return *staticCommaRegExp(); + static QStringList categories = QStringList() + << QLatin1String(IFW_COMPONENT_CHECKER) + << QLatin1String(IFW_RESOURCES) + << QLatin1String(IFW_TRANSLATIONS); + return categories; } -QStringList loggingCategories() +Q_GLOBAL_STATIC_WITH_ARGS(QRegExp, staticCommaRegExp, (QLatin1String("\\b(,|, )\\b"))); +QRegExp commaRegExp() { - static QStringList categories = QStringList() << QLatin1String(IFW_COMPONENT_CHECKER); - return categories; + return *staticCommaRegExp(); } } // namespace QInstaller diff --git a/src/libs/installer/globals.h b/src/libs/installer/globals.h index 3d6461690..53ce4ffb5 100644 --- a/src/libs/installer/globals.h +++ b/src/libs/installer/globals.h @@ -42,10 +42,13 @@ namespace QInstaller { Q_DECLARE_LOGGING_CATEGORY(lcComponentChecker) +Q_DECLARE_LOGGING_CATEGORY(lcResources) +Q_DECLARE_LOGGING_CATEGORY(lcTranslations) -QRegExp INSTALLER_EXPORT commaRegExp(); QStringList INSTALLER_EXPORT loggingCategories(); +QRegExp INSTALLER_EXPORT commaRegExp(); + } // QInstaller #endif // GLOBALS_H diff --git a/src/sdk/commandlineparser.cpp b/src/sdk/commandlineparser.cpp index abf8abea6..4a1f0080f 100644 --- a/src/sdk/commandlineparser.cpp +++ b/src/sdk/commandlineparser.cpp @@ -82,6 +82,8 @@ CommandLineParser::CommandLineParser() "Comma separated logging rules have the following syntax: " "loggingCategory=true/false. " "Passing empty logging rules enables all logging categories. " + "The following rules enable a single category: " + "ifw.*=false,ifw.category=true " "The following logging categories are available:\n") + QInstaller::loggingCategories().join(QLatin1Char('\n')), QLatin1String("rules"))); diff --git a/src/sdk/installerbase.cpp b/src/sdk/installerbase.cpp index cff394e78..343a0a1ca 100644 --- a/src/sdk/installerbase.cpp +++ b/src/sdk/installerbase.cpp @@ -51,6 +51,7 @@ #include <productkeycheck.h> #include <settings.h> #include <utils.h> +#include <globals.h> #include <kdrunoncechecker.h> #include <kdupdaterfiledownloaderfactory.h> @@ -111,10 +112,6 @@ int InstallerBase::run() QString loggingRules(QLatin1String("ifw.* = false")); // disable all by default if (QInstaller::isVerbose()) { - qDebug() << "Language:" << QLocale().uiLanguages().value(0, - QLatin1String("No UI language set")).toUtf8().constData(); - qDebug() << "Arguments: " << arguments().join(QLatin1String(", ")).toUtf8().constData(); - loggingRules = QString(); // enable all in verbose mode if (parser.isSet(QLatin1String(CommandLineOptions::LoggingRules))) { loggingRules = parser.value(QLatin1String(CommandLineOptions::LoggingRules)) @@ -124,6 +121,10 @@ int InstallerBase::run() } QLoggingCategory::setFilterRules(loggingRules); + qCDebug(QInstaller::lcTranslations) << "Language:" << QLocale().uiLanguages() + .value(0, QLatin1String("No UI language set")).toUtf8().constData(); + qDebug() << "Arguments: " << arguments().join(QLatin1String(", ")).toUtf8().constData(); + SDKApp::registerMetaResources(manager.collectionByName("QResources")); if (parser.isSet(QLatin1String(CommandLineOptions::StartClient))) { const QStringList arguments = parser.value(QLatin1String(CommandLineOptions::StartClient)) @@ -144,8 +145,8 @@ int InstallerBase::run() ProductKeyCheck::instance()->addPackagesFromXml(QLatin1String(":/metadata/Updates.xml")); BinaryFormatEngineHandler::instance()->registerResources(manager.collections()); } - if (QInstaller::isVerbose()) - dumpResourceTree(); + + dumpResourceTree(); QString controlScript; if (parser.isSet(QLatin1String(CommandLineOptions::Script))) { @@ -294,13 +295,13 @@ int InstallerBase::run() void InstallerBase::dumpResourceTree() const { - qDebug() << "Resource tree:"; + qCDebug(QInstaller::lcResources) << "Resource tree:"; QDirIterator it(QLatin1String(":/"), QDir::NoDotAndDotDot | QDir::AllEntries | QDir::Hidden, QDirIterator::Subdirectories); while (it.hasNext()) { if (it.next().startsWith(QLatin1String(":/qt-project.org"))) continue; - qDebug() << " " << it.filePath().toUtf8().constData(); + qCDebug(QInstaller::lcResources) << " " << it.filePath().toUtf8().constData(); } } |