diff options
author | Jarek Kobus <jaroslaw.kobus@theqtcompany.com> | 2015-04-23 12:00:17 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@theqtcompany.com> | 2015-04-24 12:57:10 +0000 |
commit | 2554ccb7ba4ef3103411e38b0c2d5d218217cccd (patch) | |
tree | c2ba19a0d5b834f2f5783c725dc115e3c3b4efbe /src/sdk/installerbase.cpp | |
parent | 61bf0345cdc86dc4053a5c2c1c3f782b5fd970ed (diff) |
Enable logging categories as an installer option.
Now by default all categories are disabled.
They get enabled only in verbose mode.
Verbose mode enables all categories by default.
Categories can be filtered using logging-rules option.
Change-Id: I9324826a6e2d7a746e3d7369747fcd31a42b84b6
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'src/sdk/installerbase.cpp')
-rw-r--r-- | src/sdk/installerbase.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/sdk/installerbase.cpp b/src/sdk/installerbase.cpp index 7d0b4c58e..cff394e78 100644 --- a/src/sdk/installerbase.cpp +++ b/src/sdk/installerbase.cpp @@ -75,8 +75,6 @@ InstallerBase::~InstallerBase() int InstallerBase::run() { - QLoggingCategory::setFilterRules(QLatin1String("ifw.componentChecker = false")); - KDRunOnceChecker runCheck(qApp->applicationDirPath() + QLatin1String("/lockmyApp1234865.lock")); if (runCheck.isRunning(KDRunOnceChecker::ConditionFlag::Lockfile)) { // It is possible to install an application and thus the maintenance tool into a @@ -108,14 +106,23 @@ int InstallerBase::run() QInstaller::BinaryContent::readBinaryContent(&binary, &oldOperations, &manager, &magicMarker, cookie); + CommandLineParser parser; + parser.parse(arguments()); + + 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(); - } - CommandLineParser parser; - parser.parse(arguments()); + loggingRules = QString(); // enable all in verbose mode + if (parser.isSet(QLatin1String(CommandLineOptions::LoggingRules))) { + loggingRules = parser.value(QLatin1String(CommandLineOptions::LoggingRules)) + .split(QLatin1Char(','), QString::SkipEmptyParts) + .join(QLatin1Char('\n')); // take rules from command line + } + } + QLoggingCategory::setFilterRules(loggingRules); SDKApp::registerMetaResources(manager.collectionByName("QResources")); if (parser.isSet(QLatin1String(CommandLineOptions::StartClient))) { |