summaryrefslogtreecommitdiffstats
path: root/src/sdk
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2020-07-03 09:49:41 +0300
committerKatja Marttila <katja.marttila@qt.io>2020-08-24 13:44:24 +0300
commit40c43e4c312c9f1cc4e2e44ac31b4482ccbbc6c0 (patch)
tree060519ebd49fcfaac5129bc395e5c849d318b46f /src/sdk
parentf2ab63396c1f101216b2c6ade37528492e464785 (diff)
Add verbose levels and cleanup log categories
Setting several verbose switches enables more logging and performs component checking. Also cleanup some logging categories and unify the rules. Task-number: QTIFW-1914 Change-Id: I9195f4bb02affaa87e66cf9023a3512e65e0645b Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'src/sdk')
-rw-r--r--src/sdk/installerbase.cpp30
-rw-r--r--src/sdk/main.cpp21
-rw-r--r--src/sdk/sdkapp.h26
-rw-r--r--src/sdk/tabcontroller.cpp2
4 files changed, 45 insertions, 34 deletions
diff --git a/src/sdk/installerbase.cpp b/src/sdk/installerbase.cpp
index 5b513e7a6..914be33f6 100644
--- a/src/sdk/installerbase.cpp
+++ b/src/sdk/installerbase.cpp
@@ -83,11 +83,8 @@ int InstallerBase::run()
controlScript = QLatin1String(":/metadata/installer-config/")
+ m_core->settings().controlScript();
}
- qCDebug(QInstaller::lcTranslations) << "Language:" << QLocale().uiLanguages()
+ qCDebug(QInstaller::lcInstallerInstallLog) << "Language:" << QLocale().uiLanguages()
.value(0, QLatin1String("No UI language set")).toUtf8().constData();
- qCDebug(QInstaller::lcInstallerInstallLog).noquote() << "Arguments:" << arguments().join(QLatin1String(", "));
-
- dumpResourceTree();
const QString directory = QLatin1String(":/translations");
// Check if there is a modified translation first to enable people
@@ -132,9 +129,9 @@ int InstallerBase::run()
QDirIterator fontIt(QStringLiteral(":/fonts"));
while (fontIt.hasNext()) {
const QString path = fontIt.next();
- qCDebug(QInstaller::lcResources) << "Registering custom font" << path;
+ qCDebug(QInstaller::lcDeveloperBuild) << "Registering custom font" << path;
if (QFontDatabase::addApplicationFont(path) == -1)
- qCWarning(QInstaller::lcInstallerInstallLog) << "Failed to register font!";
+ qCWarning(QInstaller::lcDeveloperBuild) << "Failed to register font!";
}
}
//create the wizard GUI
@@ -158,11 +155,11 @@ int InstallerBase::run()
}
if (squishPort != 0) {
if (Squish::allowAttaching(squishPort))
- qCDebug(QInstaller::lcGeneral) << "Attaching to squish port " << squishPort << " succeeded";
+ qCDebug(QInstaller::lcDeveloperBuild) << "Attaching to squish port " << squishPort << " succeeded";
else
- qCDebug(QInstaller::lcGeneral) << "Attaching to squish failed.";
+ qCDebug(QInstaller::lcDeveloperBuild) << "Attaching to squish failed.";
} else {
- qCWarning(QInstaller::lcGeneral) << "Invalid squish port number: " << squishPort;
+ qCWarning(QInstaller::lcDeveloperBuild) << "Invalid squish port number: " << squishPort;
}
#endif
const int result = QCoreApplication::instance()->exec();
@@ -186,18 +183,3 @@ int InstallerBase::run()
return QInstaller::PackageManagerCore::Failure;
}
-
-
-// -- private
-
-void InstallerBase::dumpResourceTree() const
-{
- 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;
- qCDebug(QInstaller::lcResources) << " " << it.filePath().toUtf8().constData();
- }
-}
diff --git a/src/sdk/main.cpp b/src/sdk/main.cpp
index 8243beb5e..1f600a4e9 100644
--- a/src/sdk/main.cpp
+++ b/src/sdk/main.cpp
@@ -195,15 +195,22 @@ int main(int argc, char *argv[])
}
try {
- // Check if any options requiring verbose output is set
- bool setVerbose = parser.isSet(CommandLineOptions::scVerboseLong);
+ QStringList optionNames = parser.optionNames();
- foreach (const QString &option, CommandLineOptions::scCommandLineInterfaceOptions) {
- if (setVerbose) break;
- setVerbose = parser.positionalArguments().contains(option);
+ //Verbose level can be increased by setting the verbose multiple times
+ foreach (QString value, optionNames) {
+ if (value == CommandLineOptions::scVerboseShort
+ || value == CommandLineOptions::scVerboseLong) {
+ QInstaller::setVerbose(true);
+ }
}
- if (setVerbose) {
- QInstaller::setVerbose(true);
+
+ foreach (const QString &option, CommandLineOptions::scCommandLineInterfaceOptions) {
+ bool setVerbose = parser.positionalArguments().contains(option);
+ if (setVerbose) {
+ QInstaller::setVerbose(setVerbose);
+ break;
+ }
}
const QStringList unknownOptionNames = parser.unknownOptionNames();
diff --git a/src/sdk/sdkapp.h b/src/sdk/sdkapp.h
index 845cad6ce..c15e10c7b 100644
--- a/src/sdk/sdkapp.h
+++ b/src/sdk/sdkapp.h
@@ -49,6 +49,7 @@
#include <QApplication>
#include <QDir>
+#include <QDirIterator>
#include <QFileInfo>
#include <QResource>
#include <QLoggingCategory>
@@ -146,7 +147,8 @@ public:
QString loggingRules;
if (m_parser.isSet(CommandLineOptions::scLoggingRulesLong)) {
- loggingRules = m_parser.value(CommandLineOptions::scLoggingRulesLong)
+ loggingRules = QLatin1String("ifw.* = false\n");
+ loggingRules += m_parser.value(CommandLineOptions::scLoggingRulesLong)
.split(QLatin1Char(','), QString::SkipEmptyParts)
.join(QLatin1Char('\n')); // take rules from command line
} else if (isCommandLineInterface) {
@@ -165,7 +167,16 @@ public:
"ifw.package.version = true\n"
"ifw.package.displayname = true\n");
}
+
+ if (QInstaller::verboseLevel() > 1) {
+ loggingRules += QLatin1String("\nifw.developer.build = true\n"
+ "ifw.package.* = true\n");
+ }
QLoggingCategory::setFilterRules(loggingRules);
+ qCDebug(QInstaller::lcInstallerInstallLog).noquote() << "Arguments:" <<
+ QCoreApplication::arguments().join(QLatin1String(", "));
+
+ dumpResourceTree();
SDKApp::registerMetaResources(manager.collectionByName("QResources"));
QInstaller::BinaryFormatEngineHandler::instance()->registerResources(manager.collections());
@@ -416,7 +427,7 @@ public:
{
const QStringList items = list.split(QLatin1Char(','), QString::SkipEmptyParts);
foreach (const QString &item, items)
- qCDebug(QInstaller::lcGeneral) << "Adding custom repository:" << item;
+ qCDebug(QInstaller::lcInstallerInstallLog) << "Adding custom repository:" << item;
return items;
}
@@ -458,6 +469,17 @@ public:
}
return QString();
}
+ void dumpResourceTree() const
+ {
+ qCDebug(QInstaller::lcDeveloperBuild) << "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;
+ qCDebug(QInstaller::lcDeveloperBuild) << " " << it.filePath().toUtf8().constData();
+ }
+ }
private:
QList<QByteArray> m_resourceMappings;
diff --git a/src/sdk/tabcontroller.cpp b/src/sdk/tabcontroller.cpp
index 623b6d445..b69c69b33 100644
--- a/src/sdk/tabcontroller.cpp
+++ b/src/sdk/tabcontroller.cpp
@@ -112,7 +112,7 @@ int TabController::init()
// this should called as early as possible, to handle error message boxes for example
if (!d->m_controlScript.isEmpty()) {
d->m_gui->loadControlScript(d->m_controlScript);
- qCDebug(QInstaller::lcGeneral) << "Using control script:" << d->m_controlScript;
+ qCDebug(QInstaller::lcInstallerInstallLog) << "Using control script:" << d->m_controlScript;
}
connect(d->m_gui, &QWizard::currentIdChanged, this, &TabController::onCurrentIdChanged);