From ae5511c2f31709f4cf25e67dc35d95507333c940 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 12 Feb 2018 08:03:04 -0500 Subject: [PATCH 1/7] [libcalamares] Rationalize logging - Move logging-levels to an enum - (re-)Order logging-levels so that the normal debug statement is not the most-important (lowest level). - Drop using namespace std; --- src/calamares/CalamaresApplication.cpp | 4 ++-- src/libcalamares/utils/Logger.cpp | 26 ++++++++++---------------- src/libcalamares/utils/Logger.h | 16 +++++++++++----- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/calamares/CalamaresApplication.cpp b/src/calamares/CalamaresApplication.cpp index 40d4abf24..5cfbbf21f 100644 --- a/src/calamares/CalamaresApplication.cpp +++ b/src/calamares/CalamaresApplication.cpp @@ -89,7 +89,7 @@ CalamaresApplication::init() CalamaresApplication::~CalamaresApplication() { - cDebug( LOGVERBOSE ) << "Shutting down Calamares..."; + cDebug( Logger::LOGVERBOSE ) << "Shutting down Calamares..."; // if ( JobQueue::instance() ) // JobQueue::instance()->stop(); @@ -98,7 +98,7 @@ CalamaresApplication::~CalamaresApplication() // delete JobQueue::instance(); - cDebug( LOGVERBOSE ) << "Finished shutdown."; + cDebug( Logger::LOGVERBOSE ) << "Finished shutdown."; } diff --git a/src/libcalamares/utils/Logger.cpp b/src/libcalamares/utils/Logger.cpp index 4fbac6f03..a19386ba4 100644 --- a/src/libcalamares/utils/Logger.cpp +++ b/src/libcalamares/utils/Logger.cpp @@ -2,7 +2,7 @@ * * Copyright 2010-2011, Christian Muehlhaeuser * Copyright 2014, Teo Mrnjavac - * Copyright 2017, Adriaan de Groot + * Copyright 2017-2018, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,13 +34,8 @@ #define LOGFILE_SIZE 1024 * 256 -#define RELEASE_LEVEL_THRESHOLD 0 -#define DEBUG_LEVEL_THRESHOLD LOGEXTRA - -using namespace std; - -static ofstream logfile; -static unsigned int s_threshold = 0; +static std::ofstream logfile; +static unsigned int s_threshold = 0; // Set to non-zero on first logging call static QMutex s_mutex; namespace Logger @@ -56,9 +51,9 @@ log( const char* msg, unsigned int debugLevel, bool toDisk = true ) s_threshold = LOGVERBOSE; else #ifdef QT_NO_DEBUG - s_threshold = RELEASE_LEVEL_THRESHOLD; + s_threshold = LOG_DISABLE; #else - s_threshold = DEBUG_LEVEL_THRESHOLD; + s_threshold = LOGEXTRA; #endif // Comparison is < threshold, below ++s_threshold; @@ -75,7 +70,7 @@ log( const char* msg, unsigned int debugLevel, bool toDisk = true ) << " - " << QTime::currentTime().toString().toUtf8().data() << " [" << QString::number( debugLevel ).toUtf8().data() << "]: " - << msg << endl; + << msg << std::endl; logfile.flush(); } @@ -84,11 +79,10 @@ log( const char* msg, unsigned int debugLevel, bool toDisk = true ) { QMutexLocker lock( &s_mutex ); - cout << QTime::currentTime().toString().toUtf8().data() + std::cout << QTime::currentTime().toString().toUtf8().data() << " [" << QString::number( debugLevel ).toUtf8().data() << "]: " - << msg << endl; - - cout.flush(); + << msg << std::endl; + std::cout.flush(); } } @@ -155,7 +149,7 @@ setupLogfile() cDebug() << "Using log file:" << logFile(); - logfile.open( logFile().toLocal8Bit(), ios::app ); + logfile.open( logFile().toLocal8Bit(), std::ios::app ); qInstallMessageHandler( CalamaresLogHandler ); } diff --git a/src/libcalamares/utils/Logger.h b/src/libcalamares/utils/Logger.h index 7f9077035..9244100de 100644 --- a/src/libcalamares/utils/Logger.h +++ b/src/libcalamares/utils/Logger.h @@ -25,13 +25,19 @@ #include "DllMacro.h" -#define LOGDEBUG 1 -#define LOGINFO 2 -#define LOGEXTRA 5 -#define LOGVERBOSE 8 - namespace Logger { + enum + { + LOG_DISABLE = 0, + LOGERROR = 1, + LOGWARNING = 2, + LOGINFO = 3, + LOGEXTRA = 5, + LOGDEBUG = 6, + LOGVERBOSE = 8 + } ; + class DLLEXPORT CLog : public QDebug { public: From 79d81700b30b9c295b8baa64257b62898cf4d7ad Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 12 Feb 2018 09:57:12 -0500 Subject: [PATCH 2/7] [libcalamares] Use -D for just debug-level setting - Original flag -d sets debugging but also changes behavior - New -D just sets debugging - Simplify QStringList (use C++ 11) --- src/calamares/main.cpp | 9 ++++++--- src/libcalamares/utils/Logger.cpp | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/calamares/main.cpp b/src/calamares/main.cpp index e22a8a0ad..04e0dab3b 100644 --- a/src/calamares/main.cpp +++ b/src/calamares/main.cpp @@ -63,11 +63,14 @@ main( int argc, char* argv[] ) parser.setApplicationDescription( "Distribution-independent installer framework" ); parser.addHelpOption(); parser.addVersionOption(); - QCommandLineOption debugOption( QStringList() << "d" << "debug", - "Verbose output for debugging purposes." ); + QCommandLineOption debugOption( QStringList{ "d", "debug"}, + "Also look in current directory for configuration. Implies -D." ); parser.addOption( debugOption ); - QCommandLineOption configOption( QStringList() << "c" << "config", + parser.addOption( QCommandLineOption( QStringLiteral("D"), + "Verbose output for debugging purposes." ) ); + + QCommandLineOption configOption( QStringList{ "c", "config"}, "Configuration directory to use, for testing purposes.", "config" ); parser.addOption( configOption ); diff --git a/src/libcalamares/utils/Logger.cpp b/src/libcalamares/utils/Logger.cpp index a19386ba4..69a370451 100644 --- a/src/libcalamares/utils/Logger.cpp +++ b/src/libcalamares/utils/Logger.cpp @@ -47,7 +47,8 @@ log( const char* msg, unsigned int debugLevel, bool toDisk = true ) if ( !s_threshold ) { if ( qApp->arguments().contains( "--debug" ) || - qApp->arguments().contains( "-d" ) ) + qApp->arguments().contains( "-d" ) || + qApp->arguments().contains( "-D" ) ) s_threshold = LOGVERBOSE; else #ifdef QT_NO_DEBUG From df0d9dcb88caf113979eb325432885eaee0502fb Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 12 Feb 2018 10:20:03 -0500 Subject: [PATCH 3/7] [libcalamares] Provide convenience functions for warning and error --- src/calamares/CalamaresApplication.cpp | 14 +++++++------- src/libcalamares/PythonHelper.cpp | 2 +- src/libcalamares/utils/CommandList.cpp | 10 +++++----- src/libcalamares/utils/Logger.h | 2 ++ 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/calamares/CalamaresApplication.cpp b/src/calamares/CalamaresApplication.cpp index 5cfbbf21f..f606bb78b 100644 --- a/src/calamares/CalamaresApplication.cpp +++ b/src/calamares/CalamaresApplication.cpp @@ -143,7 +143,7 @@ CalamaresApplication::initQmlPath() .absoluteFilePath( subpath ) ); if ( !importPath.exists() || !importPath.isReadable() ) { - cLog() << "FATAL ERROR: explicitly configured application data directory" + cError() << "FATAL: explicitly configured application data directory" << CalamaresUtils::appDataDir().absolutePath() << "does not contain a valid QML modules directory at" << importPath.absolutePath() @@ -176,7 +176,7 @@ CalamaresApplication::initQmlPath() if ( !importPath.exists() || !importPath.isReadable() ) { - cLog() << "FATAL ERROR: none of the expected QML paths (" + cError() << "FATAL: none of the expected QML paths (" << qmlDirCandidatesByPriority.join( ", " ) << ") exist." << "\nCowardly refusing to continue startup without the QML directory."; @@ -197,7 +197,7 @@ CalamaresApplication::initSettings() settingsFile = QFileInfo( CalamaresUtils::appDataDir().absoluteFilePath( "settings.conf" ) ); if ( !settingsFile.exists() || !settingsFile.isReadable() ) { - cLog() << "FATAL ERROR: explicitly configured application data directory" + cError() << "FATAL: explicitly configured application data directory" << CalamaresUtils::appDataDir().absolutePath() << "does not contain a valid settings.conf file." << "\nCowardly refusing to continue startup without settings."; @@ -230,7 +230,7 @@ CalamaresApplication::initSettings() if ( !settingsFile.exists() || !settingsFile.isReadable() ) { - cLog() << "FATAL ERROR: none of the expected configuration file paths (" + cError() << "FATAL: none of the expected configuration file paths (" << settingsFileCandidatesByPriority.join( ", " ) << ") contain a valid settings.conf file." << "\nCowardly refusing to continue startup without settings."; @@ -248,7 +248,7 @@ CalamaresApplication::initBranding() QString brandingComponentName = Calamares::Settings::instance()->brandingComponentName(); if ( brandingComponentName.simplified().isEmpty() ) { - cLog() << "FATAL ERROR: branding component not set in settings.conf"; + cError() << "FATAL: branding component not set in settings.conf"; ::exit( EXIT_FAILURE ); } @@ -262,7 +262,7 @@ CalamaresApplication::initBranding() .absoluteFilePath( brandingDescriptorSubpath ) ); if ( !brandingFile.exists() || !brandingFile.isReadable() ) { - cLog() << "FATAL ERROR: explicitly configured application data directory" + cError() << "FATAL: explicitly configured application data directory" << CalamaresUtils::appDataDir().absolutePath() << "does not contain a valid branding component descriptor at" << brandingFile.absoluteFilePath() @@ -299,7 +299,7 @@ CalamaresApplication::initBranding() if ( !brandingFile.exists() || !brandingFile.isReadable() ) { - cLog() << "FATAL ERROR: none of the expected branding descriptor file paths (" + cError() << "FATAL: none of the expected branding descriptor file paths (" << brandingFileCandidatesByPriority.join( ", " ) << ") contain a valid branding.desc file." << "\nCowardly refusing to continue startup without branding."; diff --git a/src/libcalamares/PythonHelper.cpp b/src/libcalamares/PythonHelper.cpp index f274ac276..e5eb85084 100644 --- a/src/libcalamares/PythonHelper.cpp +++ b/src/libcalamares/PythonHelper.cpp @@ -223,7 +223,7 @@ Helper::Helper( QObject* parent ) } else { - cDebug() << "WARNING: creating PythonHelper more than once. This is very bad."; + cWarning() << "creating PythonHelper more than once. This is very bad."; return; } diff --git a/src/libcalamares/utils/CommandList.cpp b/src/libcalamares/utils/CommandList.cpp index a6e5151bd..298fc7b6c 100644 --- a/src/libcalamares/utils/CommandList.cpp +++ b/src/libcalamares/utils/CommandList.cpp @@ -38,7 +38,7 @@ static CommandLine get_variant_object( const QVariantMap& m ) if ( !command.isEmpty() ) return CommandLine( command, timeout ); - cDebug() << "WARNING Bad CommandLine element" << m; + cWarning() << "Bad CommandLine element" << m; return CommandLine(); } @@ -58,7 +58,7 @@ static CommandList_t get_variant_stringlist( const QVariantList& l ) // Otherwise warning is already given } else - cDebug() << "WARNING Bad CommandList element" << c << v.type() << v; + cWarning() << "Bad CommandList element" << c << v.type() << v; ++c; } return retl; @@ -79,7 +79,7 @@ CommandList::CommandList::CommandList( const QVariant& v, bool doChroot, int tim if ( v_list.count() ) append( get_variant_stringlist( v_list ) ); else - cDebug() << "WARNING: Empty CommandList"; + cWarning() << "Empty CommandList"; } else if ( v.type() == QVariant::String ) append( v.toString() ); @@ -91,7 +91,7 @@ CommandList::CommandList::CommandList( const QVariant& v, bool doChroot, int tim // Otherwise warning is already given } else - cDebug() << "WARNING: CommandList does not understand variant" << v.type(); + cWarning() << "CommandList does not understand variant" << v.type(); } CommandList::~CommandList() @@ -109,7 +109,7 @@ Calamares::JobResult CommandList::run() { if ( !gs || !gs->contains( "rootMountPoint" ) ) { - cDebug() << "ERROR: No rootMountPoint defined."; + cError() << "No rootMountPoint defined."; return Calamares::JobResult::error( QCoreApplication::translate( "CommandList", "Could not run command." ), QCoreApplication::translate( "CommandList", "No rootMountPoint is defined, so command cannot be run in the target environment." ) ); } diff --git a/src/libcalamares/utils/Logger.h b/src/libcalamares/utils/Logger.h index 9244100de..b6c0b4fa7 100644 --- a/src/libcalamares/utils/Logger.h +++ b/src/libcalamares/utils/Logger.h @@ -65,5 +65,7 @@ namespace Logger #define cLog Logger::CLog #define cDebug Logger::CDebug +#define cWarning() Logger::CDebug(Logger::LOGWARNING) << "WARNING:" +#define cError() Logger::CDebug(Logger::LOGERROR) << "ERROR:" #endif // CALAMARES_LOGGER_H From 60f440f72b39ed56acf09a2c8a23831cd431f752 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 12 Feb 2018 10:46:57 -0500 Subject: [PATCH 4/7] [libcalamaresui] Use new convenience logging methods - Remove a few confusing Q_FUNCINFO --- src/libcalamaresui/Branding.cpp | 10 +++++----- src/libcalamaresui/Settings.cpp | 4 ++-- src/libcalamaresui/modulesystem/Module.cpp | 5 ++--- .../modulesystem/ModuleManager.cpp | 16 ++++++++-------- src/libcalamaresui/utils/YamlUtils.cpp | 4 ++-- .../viewpages/PythonQtViewStep.cpp | 2 +- 6 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/libcalamaresui/Branding.cpp b/src/libcalamaresui/Branding.cpp index 899e90e64..5c4296491 100644 --- a/src/libcalamaresui/Branding.cpp +++ b/src/libcalamaresui/Branding.cpp @@ -166,7 +166,7 @@ Branding::Branding( const QString& brandingFilePath, } else bail( "Syntax error in slideshow sequence." ); - + if ( !doc[ "style" ].IsMap() ) bail( "Syntax error in style map." ); @@ -179,12 +179,12 @@ Branding::Branding( const QString& brandingFilePath, } catch ( YAML::Exception& e ) { - cDebug() << "WARNING: YAML parser error " << e.what() << "in" << file.fileName(); + cWarning() << "YAML parser error " << e.what() << "in" << file.fileName(); } QDir translationsDir( componentDir.filePath( "lang" ) ); if ( !translationsDir.exists() ) - cDebug() << "WARNING: the selected branding component does not ship translations."; + cWarning() << "the selected branding component does not ship translations."; m_translationsPathPrefix = translationsDir.absolutePath(); m_translationsPathPrefix.append( QString( "%1calamares-%2" ) .arg( QDir::separator() ) @@ -192,13 +192,13 @@ Branding::Branding( const QString& brandingFilePath, } else { - cDebug() << "WARNING: Cannot read " << file.fileName(); + cWarning() << "Cannot read " << file.fileName(); } s_instance = this; if ( m_componentName.isEmpty() ) { - cDebug() << "WARNING: failed to load component from" << brandingFilePath; + cWarning() << "Failed to load component from" << brandingFilePath; } else { diff --git a/src/libcalamaresui/Settings.cpp b/src/libcalamaresui/Settings.cpp index 4affd4e94..06178c621 100644 --- a/src/libcalamaresui/Settings.cpp +++ b/src/libcalamaresui/Settings.cpp @@ -156,12 +156,12 @@ Settings::Settings( const QString& settingsFilePath, } catch ( YAML::Exception& e ) { - cDebug() << "WARNING: YAML parser error " << e.what() << "in" << file.fileName(); + cWarning() << "YAML parser error " << e.what() << "in" << file.fileName(); } } else { - cDebug() << "WARNING: Cannot read " << file.fileName(); + cWarning() << "Cannot read " << file.fileName(); } s_instance = this; diff --git a/src/libcalamaresui/modulesystem/Module.cpp b/src/libcalamaresui/modulesystem/Module.cpp index 6b9f57182..91642f415 100644 --- a/src/libcalamaresui/modulesystem/Module.cpp +++ b/src/libcalamaresui/modulesystem/Module.cpp @@ -145,7 +145,7 @@ Module::fromDescriptor( const QVariantMap& moduleDescriptor, } catch ( YAML::Exception& e ) { - cDebug() << "WARNING: YAML parser error " << e.what(); + cWarning() << "YAML parser error " << e.what(); delete m; return nullptr; } @@ -197,8 +197,7 @@ Module::loadConfigurationFile( const QString& configFileName ) //throws YAML::Ex } if ( !doc.IsMap() ) { - cLog() << Q_FUNC_INFO << "bad module configuration format" - << path; + cWarning() << "Bad module configuration format" << path; return; } diff --git a/src/libcalamaresui/modulesystem/ModuleManager.cpp b/src/libcalamaresui/modulesystem/ModuleManager.cpp index 350f05fed..60b9b2ce9 100644 --- a/src/libcalamaresui/modulesystem/ModuleManager.cpp +++ b/src/libcalamaresui/modulesystem/ModuleManager.cpp @@ -116,7 +116,7 @@ ModuleManager::doInit() } catch ( YAML::Exception& e ) { - cDebug() << "WARNING: YAML parser error " << e.what(); + cWarning() << "YAML parser error " << e.what(); continue; } } @@ -140,7 +140,7 @@ ModuleManager::doInit() } else { - cDebug() << Q_FUNC_INFO << "cannot cd into module directory " + cWarning() << "Cannot cd into module directory " << path << "/" << subdir; } } @@ -200,7 +200,7 @@ ModuleManager::loadModules() if ( moduleEntrySplit.length() < 1 || moduleEntrySplit.length() > 2 ) { - cDebug() << "Wrong module entry format for module" << moduleEntry << "." + cError() << "Wrong module entry format for module" << moduleEntry << "." << "\nCalamares will now quit."; qApp->exit( 1 ); return; @@ -212,7 +212,7 @@ ModuleManager::loadModules() if ( !m_availableDescriptorsByModuleName.contains( moduleName ) || m_availableDescriptorsByModuleName.value( moduleName ).isEmpty() ) { - cDebug() << "Module" << moduleName << "not found in module search paths." + cError() << "Module" << moduleName << "not found in module search paths." << "\nCalamares will now quit."; qApp->exit( 1 ); return; @@ -240,7 +240,7 @@ ModuleManager::loadModules() } else //ought to be a custom instance, but cannot find instance entry { - cDebug() << "Custom instance" << moduleEntry << "not found in custom instances section." + cError() << "Custom instance" << moduleEntry << "not found in custom instances section." << "\nCalamares will now quit."; qApp->exit( 1 ); return; @@ -263,7 +263,7 @@ ModuleManager::loadModules() m_loadedModulesByInstanceKey.value( instanceKey, nullptr ); if ( thisModule && !thisModule->isLoaded() ) { - cDebug() << "Module" << instanceKey << "exists but not loaded." + cError() << "Module" << instanceKey << "exists but not loaded." << "\nCalamares will now quit."; qApp->exit( 1 ); return; @@ -282,7 +282,7 @@ ModuleManager::loadModules() m_moduleDirectoriesByModuleName.value( moduleName ) ); if ( !thisModule ) { - cDebug() << "Module" << instanceKey << "cannot be created from descriptor."; + cWarning() << "Module" << instanceKey << "cannot be created from descriptor."; Q_ASSERT( thisModule ); continue; } @@ -292,7 +292,7 @@ ModuleManager::loadModules() Q_ASSERT( thisModule->isLoaded() ); if ( !thisModule->isLoaded() ) { - cDebug() << "Module" << moduleName << "loading FAILED"; + cWarning() << "Module" << moduleName << "loading FAILED"; continue; } } diff --git a/src/libcalamaresui/utils/YamlUtils.cpp b/src/libcalamaresui/utils/YamlUtils.cpp index 8113e3913..962cbd1da 100644 --- a/src/libcalamaresui/utils/YamlUtils.cpp +++ b/src/libcalamaresui/utils/YamlUtils.cpp @@ -111,7 +111,7 @@ yamlMapToVariant( const YAML::Node& mapNode ) void explainYamlException( const YAML::Exception& e, const QByteArray& yamlData, const char *label ) { - cDebug() << "WARNING: YAML error " << e.what() << "in" << label << '.'; + cWarning() << "YAML error " << e.what() << "in" << label << '.'; if ( ( e.mark.line >= 0 ) && ( e.mark.column >= 0 ) ) { // Try to show the line where it happened. @@ -141,7 +141,7 @@ explainYamlException( const YAML::Exception& e, const QByteArray& yamlData, cons rangeend = rangestart + 40; if ( linestart >= 0 ) - cDebug() << "WARNING: offending YAML data:" << yamlData.mid( rangestart, rangeend-rangestart ).constData(); + cWarning() << "offending YAML data:" << yamlData.mid( rangestart, rangeend-rangestart ).constData(); } } diff --git a/src/libcalamaresui/viewpages/PythonQtViewStep.cpp b/src/libcalamaresui/viewpages/PythonQtViewStep.cpp index 9548c8752..72e434780 100644 --- a/src/libcalamaresui/viewpages/PythonQtViewStep.cpp +++ b/src/libcalamaresui/viewpages/PythonQtViewStep.cpp @@ -80,7 +80,7 @@ QWidget* PythonQtViewStep::widget() { if ( m_widget->layout()->count() > 1 ) - cDebug() << "WARNING: PythonQtViewStep wrapper widget has more than 1 child. " + cWarning() << "PythonQtViewStep wrapper widget has more than 1 child. " "This should never happen."; bool nothingChanged = m_cxt.evalScript( From 3f77fb1d166c129f1ec79014de43c3291100dfb7 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 12 Feb 2018 11:55:06 -0500 Subject: [PATCH 5/7] [modules] Use new convenience logging methods --- .../ContextualProcessJob.cpp | 4 ++-- .../keyboardwidget/keyboardpreview.cpp | 4 ++-- src/modules/locale/LocalePage.cpp | 4 ++-- .../welcome/checker/RequirementsChecker.cpp | 22 +++++++++---------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/modules/contextualprocess/ContextualProcessJob.cpp b/src/modules/contextualprocess/ContextualProcessJob.cpp index 0a1a2fc1a..f03d53466 100644 --- a/src/modules/contextualprocess/ContextualProcessJob.cpp +++ b/src/modules/contextualprocess/ContextualProcessJob.cpp @@ -110,7 +110,7 @@ ContextualProcessJob::setConfigurationMap( const QVariantMap& configurationMap ) if ( iter.value().type() != QVariant::Map ) { - cDebug() << "WARNING:" << moduleInstanceKey() << "bad configuration values for" << variableName; + cWarning() << moduleInstanceKey() << "bad configuration values for" << variableName; continue; } @@ -120,7 +120,7 @@ ContextualProcessJob::setConfigurationMap( const QVariantMap& configurationMap ) QString valueString = valueiter.key(); if ( variableName.isEmpty() ) { - cDebug() << "WARNING:" << moduleInstanceKey() << "variable" << variableName << "unrecognized value" << valueiter.key(); + cWarning() << moduleInstanceKey() << "variable" << variableName << "unrecognized value" << valueiter.key(); continue; } diff --git a/src/modules/keyboard/keyboardwidget/keyboardpreview.cpp b/src/modules/keyboard/keyboardwidget/keyboardpreview.cpp index 57f483200..535edaf24 100644 --- a/src/modules/keyboard/keyboardwidget/keyboardpreview.cpp +++ b/src/modules/keyboard/keyboardwidget/keyboardpreview.cpp @@ -115,13 +115,13 @@ bool KeyBoardPreview::loadCodes() { process.start("ckbcomp", param); if (!process.waitForStarted()) { - cDebug() << "WARNING: ckbcomp not found , keyboard preview disabled"; + cWarning() << "ckbcomp not found , keyboard preview disabled"; return false; } if (!process.waitForFinished()) { - cDebug() << "WARNING: ckbcomp failed, keyboard preview disabled"; + cWarning() << "ckbcomp failed, keyboard preview disabled"; return false; } diff --git a/src/modules/locale/LocalePage.cpp b/src/modules/locale/LocalePage.cpp index 945c10285..27d63f48e 100644 --- a/src/modules/locale/LocalePage.cpp +++ b/src/modules/locale/LocalePage.cpp @@ -346,7 +346,7 @@ LocalePage::init( const QString& initialRegion, if ( m_localeGenLines.isEmpty() ) { - cDebug() << "WARNING: cannot acquire a list of available locales." + cWarning() << "cannot acquire a list of available locales." << "The locale and localecfg modules will be broken as long as this " "system does not provide" << "\n\t " @@ -454,7 +454,7 @@ LocalePage::guessLocaleConfiguration() const // If we cannot say anything about available locales if ( m_localeGenLines.isEmpty() ) { - cDebug() << "WARNING: guessLocaleConfiguration can't guess from an empty list."; + cWarning() << "guessLocaleConfiguration can't guess from an empty list."; return LocaleConfiguration::createDefault(); } diff --git a/src/modules/welcome/checker/RequirementsChecker.cpp b/src/modules/welcome/checker/RequirementsChecker.cpp index e6c8a77de..1aa4e95f8 100644 --- a/src/modules/welcome/checker/RequirementsChecker.cpp +++ b/src/modules/welcome/checker/RequirementsChecker.cpp @@ -220,7 +220,7 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap ) } else { - cDebug() << "WARNING: RequirementsChecker entry 'check' is incomplete."; + cWarning() << "RequirementsChecker entry 'check' is incomplete."; incompleteConfiguration = true; } @@ -232,14 +232,14 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap ) } else { - cDebug() << "WARNING: RequirementsChecker entry 'required' is incomplete."; + cWarning() << "RequirementsChecker entry 'required' is incomplete."; incompleteConfiguration = true; } // Help out with consistency, but don't fix for ( const auto& r : m_entriesToRequire ) if ( !m_entriesToCheck.contains( r ) ) - cDebug() << "WARNING: RequirementsChecker requires" << r << "but does not check it."; + cWarning() << "RequirementsChecker requires" << r << "but does not check it."; if ( configurationMap.contains( "requiredStorage" ) && ( configurationMap.value( "requiredStorage" ).type() == QVariant::Double || @@ -249,7 +249,7 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap ) m_requiredStorageGB = configurationMap.value( "requiredStorage" ).toDouble( &ok ); if ( !ok ) { - cDebug() << "WARNING: RequirementsChecker entry 'requiredStorage' is invalid."; + cWarning() << "RequirementsChecker entry 'requiredStorage' is invalid."; m_requiredStorageGB = 3.; } @@ -257,7 +257,7 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap ) } else { - cDebug() << "WARNING: RequirementsChecker entry 'requiredStorage' is missing."; + cWarning() << "RequirementsChecker entry 'requiredStorage' is missing."; m_requiredStorageGB = 3.; incompleteConfiguration = true; } @@ -270,14 +270,14 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap ) m_requiredRamGB = configurationMap.value( "requiredRam" ).toDouble( &ok ); if ( !ok ) { - cDebug() << "WARNING: RequirementsChecker entry 'requiredRam' is invalid."; + cWarning() << "RequirementsChecker entry 'requiredRam' is invalid."; m_requiredRamGB = 1.; incompleteConfiguration = true; } } else { - cDebug() << "WARNING: RequirementsChecker entry 'requiredRam' is missing."; + cWarning() << "RequirementsChecker entry 'requiredRam' is missing."; m_requiredRamGB = 1.; incompleteConfiguration = true; } @@ -289,7 +289,7 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap ) if ( m_checkHasInternetUrl.isEmpty() || !QUrl( m_checkHasInternetUrl ).isValid() ) { - cDebug() << "WARNING: RequirementsChecker entry 'internetCheckUrl' is invalid in welcome.conf" << m_checkHasInternetUrl + cWarning() << "RequirementsChecker entry 'internetCheckUrl' is invalid in welcome.conf" << m_checkHasInternetUrl << "reverting to default (http://example.com)."; m_checkHasInternetUrl = "http://example.com"; incompleteConfiguration = true; @@ -297,7 +297,7 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap ) } else { - cDebug() << "WARNING: RequirementsChecker entry 'internetCheckUrl' is undefined in welcome.conf," + cWarning() << "RequirementsChecker entry 'internetCheckUrl' is undefined in welcome.conf," "reverting to default (http://example.com)."; m_checkHasInternetUrl = "http://example.com"; @@ -305,7 +305,7 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap ) } if ( incompleteConfiguration ) - cDebug() << "WARNING: RequirementsChecker configuration map:\n" << configurationMap; + cWarning() << "RequirementsChecker configuration map:\n" << configurationMap; } @@ -320,7 +320,7 @@ bool RequirementsChecker::checkEnoughStorage( qint64 requiredSpace ) { #ifdef WITHOUT_LIBPARTED - cDebug() << "WARNING: RequirementsChecker is configured without libparted."; + cWarning() << "RequirementsChecker is configured without libparted."; return false; #else return check_big_enough( requiredSpace ); From 3315df5df1e5b16a0de2498ef37a61ca4c94cdf9 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 13 Feb 2018 11:07:12 +0100 Subject: [PATCH 6/7] [modules] Use new convenience logging methods across the board --- src/modules/netinstall/NetInstallPage.cpp | 8 ++++---- src/modules/partition/core/PartitionActions.cpp | 2 +- src/modules/partition/core/PartitionCoreModule.cpp | 2 +- src/modules/partition/gui/ChoicePage.cpp | 6 +++--- src/modules/partition/gui/PartitionViewStep.cpp | 3 ++- src/modules/partition/jobs/ClearMountsJob.cpp | 4 ++-- src/modules/plasmalnf/PlasmaLnfViewStep.cpp | 14 +++++++------- src/modules/shellprocess/ShellProcessJob.cpp | 4 ++-- src/modules/tracking/TrackingJobs.cpp | 2 +- src/modules/tracking/TrackingPage.cpp | 6 +++--- src/modules/users/CheckPWQuality.cpp | 8 ++++---- src/modules/users/UsersPage.cpp | 2 +- src/modules/users/UsersViewStep.cpp | 2 +- src/modules/welcome/WelcomeViewStep.cpp | 2 +- 14 files changed, 33 insertions(+), 32 deletions(-) diff --git a/src/modules/netinstall/NetInstallPage.cpp b/src/modules/netinstall/NetInstallPage.cpp index a8e37aa0c..b7bcdd457 100644 --- a/src/modules/netinstall/NetInstallPage.cpp +++ b/src/modules/netinstall/NetInstallPage.cpp @@ -65,7 +65,7 @@ NetInstallPage::readGroups( const QByteArray& yamlData ) YAML::Node groups = YAML::Load( yamlData.constData() ); if ( !groups.IsSequence() ) - cDebug() << "WARNING: netinstall groups data does not form a sequence."; + cWarning() << "netinstall groups data does not form a sequence."; Q_ASSERT( groups.IsSequence() ); m_groups = new PackageModel( groups ); CALAMARES_RETRANSLATE( @@ -88,7 +88,7 @@ NetInstallPage::dataIsHere( QNetworkReply* reply ) // even if the reply is corrupt or missing. if ( reply->error() != QNetworkReply::NoError ) { - cDebug() << "WARNING: unable to fetch netinstall package lists."; + cWarning() << "unable to fetch netinstall package lists."; cDebug() << " ..Netinstall reply error: " << reply->error(); cDebug() << " ..Request for url: " << reply->url().toString() << " failed with: " << reply->errorString(); ui->netinst_status->setText( tr( "Network Installation. (Disabled: Unable to fetch package lists, check your network connection)" ) ); @@ -98,7 +98,7 @@ NetInstallPage::dataIsHere( QNetworkReply* reply ) if ( !readGroups( reply->readAll() ) ) { - cDebug() << "WARNING: netinstall groups data was received, but invalid."; + cWarning() << "netinstall groups data was received, but invalid."; cDebug() << " ..Url: " << reply->url().toString(); cDebug() << " ..Headers: " << reply->rawHeaderList(); ui->netinst_status->setText( tr( "Network Installation. (Disabled: Received invalid groups data)" ) ); @@ -122,7 +122,7 @@ NetInstallPage::selectedPackages() const return m_groups->getPackages(); else { - cDebug() << "WARNING: no netinstall groups are available."; + cWarning() << "no netinstall groups are available."; return PackageModel::PackageItemDataList(); } } diff --git a/src/modules/partition/core/PartitionActions.cpp b/src/modules/partition/core/PartitionActions.cpp index 1de84d83c..e1822d434 100644 --- a/src/modules/partition/core/PartitionActions.cpp +++ b/src/modules/partition/core/PartitionActions.cpp @@ -259,7 +259,7 @@ doReplacePartition( PartitionCoreModule* core, if ( partition->roles().has( PartitionRole::Unallocated ) ) { newRoles = PartitionRole( PartitionRole::Primary ); - cDebug() << "WARNING: selected partition is free space"; + cWarning() << "selected partition is free space"; if ( partition->parent() ) { Partition* parent = dynamic_cast< Partition* >( partition->parent() ); diff --git a/src/modules/partition/core/PartitionCoreModule.cpp b/src/modules/partition/core/PartitionCoreModule.cpp index 178860e2e..c508e04ef 100644 --- a/src/modules/partition/core/PartitionCoreModule.cpp +++ b/src/modules/partition/core/PartitionCoreModule.cpp @@ -507,7 +507,7 @@ PartitionCoreModule::scanForEfiSystemPartitions() KPMHelpers::findPartitions( devices, PartUtils::isEfiBootable ); if ( efiSystemPartitions.isEmpty() ) - cDebug() << "WARNING: system is EFI but no EFI system partitions found."; + cWarning() << "system is EFI but no EFI system partitions found."; m_efiSystemPartitions = efiSystemPartitions; } diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index 008a64d8d..fdc68ef97 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -567,7 +567,7 @@ ChoicePage::onLeave() } else { - cDebug() << "ERROR: cannot set up EFI system partition.\nESP count:" + cError() << "cannot set up EFI system partition.\nESP count:" << efiSystemPartitions.count() << "\nm_efiComboBox:" << m_efiComboBox; } @@ -582,7 +582,7 @@ ChoicePage::onLeave() if ( d_p ) m_core->setBootLoaderInstallPath( d_p->deviceNode() ); else - cDebug() << "WARNING: No device selected for bootloader."; + cWarning() << "No device selected for bootloader."; } else { @@ -1315,7 +1315,7 @@ ChoicePage::setupActions() if ( isEfi && !efiSystemPartitionFound ) { - cDebug() << "WARNING: system is EFI but there's no EFI system partition, " + cWarning() << "System is EFI but there's no EFI system partition, " "DISABLING alongside and replace features."; m_alongsideButton->hide(); m_replaceButton->hide(); diff --git a/src/modules/partition/gui/PartitionViewStep.cpp b/src/modules/partition/gui/PartitionViewStep.cpp index 8e46da71a..45676e440 100644 --- a/src/modules/partition/gui/PartitionViewStep.cpp +++ b/src/modules/partition/gui/PartitionViewStep.cpp @@ -426,6 +426,7 @@ PartitionViewStep::onLeave() if ( !message.isEmpty() ) { + cWarning() << message; QMessageBox::warning( m_manualPartitionPage, message, description ); @@ -535,7 +536,7 @@ PartitionViewStep::setConfigurationMap( const QVariantMap& configurationMap ) gs->insert( "defaultFileSystemType", typeString ); if ( FileSystem::typeForName( typeString ) == FileSystem::Unknown ) { - cDebug() << "WARNING: bad default filesystem configuration for partition module. Reverting to ext4 as default."; + cWarning() << "bad default filesystem configuration for partition module. Reverting to ext4 as default."; gs->insert( "defaultFileSystemType", "ext4" ); } } diff --git a/src/modules/partition/jobs/ClearMountsJob.cpp b/src/modules/partition/jobs/ClearMountsJob.cpp index c5811cdd4..1a48becad 100644 --- a/src/modules/partition/jobs/ClearMountsJob.cpp +++ b/src/modules/partition/jobs/ClearMountsJob.cpp @@ -126,7 +126,7 @@ ClearMountsJob::exec() } } else - cDebug() << "WARNING: this system does not seem to have LVM2 tools."; + cWarning() << "this system does not seem to have LVM2 tools."; // Then we go looking for volume groups that use this device for physical volumes process.start( "pvdisplay", { "-C", "--noheadings" } ); @@ -159,7 +159,7 @@ ClearMountsJob::exec() } } else - cDebug() << "WARNING: this system does not seem to have LVM2 tools."; + cWarning() << "this system does not seem to have LVM2 tools."; const QStringList cryptoDevices2 = getCryptoDevices(); for ( const QString &mapperPath : cryptoDevices2 ) diff --git a/src/modules/plasmalnf/PlasmaLnfViewStep.cpp b/src/modules/plasmalnf/PlasmaLnfViewStep.cpp index 8a2162c3d..64c1932f6 100644 --- a/src/modules/plasmalnf/PlasmaLnfViewStep.cpp +++ b/src/modules/plasmalnf/PlasmaLnfViewStep.cpp @@ -115,7 +115,7 @@ PlasmaLnfViewStep::jobs() const if ( !m_lnfPath.isEmpty() ) l.append( Calamares::job_ptr( new PlasmaLnfJob( m_lnfPath, m_themeId ) ) ); else - cDebug() << "WARNING: no lnftool given for plasmalnf module."; + cWarning() << "no lnftool given for plasmalnf module."; } return l; } @@ -128,7 +128,7 @@ PlasmaLnfViewStep::setConfigurationMap( const QVariantMap& configurationMap ) m_widget->setLnfPath( m_lnfPath ); if ( m_lnfPath.isEmpty() ) - cDebug() << "WARNING: no lnftool given for plasmalnf module."; + cWarning() << "no lnftool given for plasmalnf module."; m_liveUser = CalamaresUtils::getString( configurationMap, "liveuser" ); @@ -150,7 +150,7 @@ PlasmaLnfViewStep::setConfigurationMap( const QVariantMap& configurationMap ) allThemes.append( ThemeInfo( i.toString() ) ); if ( allThemes.length() == 1 ) - cDebug() << "WARNING: only one theme enabled in plasmalnf"; + cWarning() << "only one theme enabled in plasmalnf"; m_widget->setEnabledThemes( allThemes ); } else @@ -163,7 +163,7 @@ PlasmaLnfViewStep::themeSelected( const QString& id ) m_themeId = id; if ( m_lnfPath.isEmpty() ) { - cDebug() << "WARNING: no lnftool given for plasmalnf module."; + cWarning() << "no lnftool given for plasmalnf module."; return; } @@ -175,17 +175,17 @@ PlasmaLnfViewStep::themeSelected( const QString& id ) if ( !lnftool.waitForStarted( 1000 ) ) { - cDebug() << "WARNING: could not start look-and-feel" << m_lnfPath; + cWarning() << "could not start look-and-feel" << m_lnfPath; return; } if ( !lnftool.waitForFinished() ) { - cDebug() << "WARNING:" << m_lnfPath << "timed out."; + cWarning() << m_lnfPath << "timed out."; return; } if ( ( lnftool.exitCode() == 0 ) && ( lnftool.exitStatus() == QProcess::NormalExit ) ) cDebug() << "Plasma look-and-feel applied" << id; else - cDebug() << "WARNING: could not apply look-and-feel" << id; + cWarning() << "could not apply look-and-feel" << id; } diff --git a/src/modules/shellprocess/ShellProcessJob.cpp b/src/modules/shellprocess/ShellProcessJob.cpp index 410f06c09..19c7bc8f1 100644 --- a/src/modules/shellprocess/ShellProcessJob.cpp +++ b/src/modules/shellprocess/ShellProcessJob.cpp @@ -58,7 +58,7 @@ ShellProcessJob::exec() if ( ! m_commands || m_commands->isEmpty() ) { - cDebug() << "WARNING: No commands to execute" << moduleInstanceKey(); + cWarning() << "No commands to execute" << moduleInstanceKey(); return Calamares::JobResult::ok(); } @@ -81,7 +81,7 @@ ShellProcessJob::setConfigurationMap( const QVariantMap& configurationMap ) cDebug() << "ShellProcessJob: \"script\" contains no commands for" << moduleInstanceKey(); } else - cDebug() << "WARNING: No script given for ShellProcessJob" << moduleInstanceKey(); + cWarning() << "No script given for ShellProcessJob" << moduleInstanceKey(); } CALAMARES_PLUGIN_FACTORY_DEFINITION( ShellProcessJobFactory, registerPlugin(); ) diff --git a/src/modules/tracking/TrackingJobs.cpp b/src/modules/tracking/TrackingJobs.cpp index 7a95f601e..717d636d3 100644 --- a/src/modules/tracking/TrackingJobs.cpp +++ b/src/modules/tracking/TrackingJobs.cpp @@ -84,7 +84,7 @@ Calamares::JobResult TrackingInstallJob::exec() if ( !timeout.isActive() ) { - cDebug() << "WARNING: install-tracking request timed out."; + cWarning() << "install-tracking request timed out."; return Calamares::JobResult::error( tr( "Internal error in install-tracking." ), tr( "HTTP request timed out." ) ); } diff --git a/src/modules/tracking/TrackingPage.cpp b/src/modules/tracking/TrackingPage.cpp index fde91f98e..1b76aa5e5 100644 --- a/src/modules/tracking/TrackingPage.cpp +++ b/src/modules/tracking/TrackingPage.cpp @@ -81,7 +81,7 @@ void TrackingPage::enableTrackingOption(TrackingType t, bool enabled) group->hide(); } else - cDebug() << "WARNING: unknown tracking option" << int(t); + cWarning() << "unknown tracking option" << int(t); } bool TrackingPage::getTrackingOption(TrackingType t) @@ -129,7 +129,7 @@ void TrackingPage::setTrackingPolicy(TrackingType t, QString url) cDebug() << "Tracking policy" << int(t) << "set to" << url; } else - cDebug() << "WARNING: unknown tracking option" << int(t); + cWarning() << "unknown tracking option" << int(t); } void TrackingPage::setGeneralPolicy( QString url ) @@ -162,5 +162,5 @@ void TrackingPage::setTrackingLevel(const QString& l) if ( button != nullptr ) button->setChecked( true ); else - cDebug() << "WARNING: unknown default tracking level" << l; + cWarning() << "unknown default tracking level" << l; } diff --git a/src/modules/users/CheckPWQuality.cpp b/src/modules/users/CheckPWQuality.cpp index 7e8cbe402..3e1ab0563 100644 --- a/src/modules/users/CheckPWQuality.cpp +++ b/src/modules/users/CheckPWQuality.cpp @@ -282,7 +282,7 @@ DEFINE_CHECK_FUNC( libpwquality ) { if ( !value.canConvert( QVariant::List ) ) { - cDebug() << "WARNING: libpwquality settings is not a list"; + cWarning() << "libpwquality settings is not a list"; return; } @@ -296,7 +296,7 @@ DEFINE_CHECK_FUNC( libpwquality ) QString option = v.toString(); int r = settings->set( option ); if ( r ) - cDebug() << " .. WARNING: unrecognized libpwquality setting" << option; + cWarning() << "unrecognized libpwquality setting" << option; else { cDebug() << " .. libpwquality setting" << option; @@ -304,7 +304,7 @@ DEFINE_CHECK_FUNC( libpwquality ) } } else - cDebug() << " .. WARNING: unrecognized libpwquality setting" << v; + cWarning() << "unrecognized libpwquality setting" << v; } /* Something actually added? */ @@ -320,7 +320,7 @@ DEFINE_CHECK_FUNC( libpwquality ) { int r = settings->check( s ); if ( r < 0 ) - cDebug() << "WARNING: libpwquality error" << r; + cWarning() << "libpwquality error" << r; else if ( r < settings->arbitrary_minimum_strength ) cDebug() << "Password strength" << r << "too low"; return r >= settings->arbitrary_minimum_strength; diff --git a/src/modules/users/UsersPage.cpp b/src/modules/users/UsersPage.cpp index ae8f03b13..86e010469 100644 --- a/src/modules/users/UsersPage.cpp +++ b/src/modules/users/UsersPage.cpp @@ -475,5 +475,5 @@ UsersPage::addPasswordCheck( const QString& key, const QVariant& value ) } #endif else - cDebug() << "WARNING: Unknown password-check key" << key; + cWarning() << "Unknown password-check key" << key; } diff --git a/src/modules/users/UsersViewStep.cpp b/src/modules/users/UsersViewStep.cpp index c670597cf..015d7e997 100644 --- a/src/modules/users/UsersViewStep.cpp +++ b/src/modules/users/UsersViewStep.cpp @@ -132,7 +132,7 @@ UsersViewStep::setConfigurationMap( const QVariantMap& configurationMap ) } else { - cDebug() << "WARNING: Using fallback groups. Please check defaultGroups in users.conf"; + cWarning() << "Using fallback groups. Please check defaultGroups in users.conf"; m_defaultGroups = QStringList{ "lp", "video", "network", "storage", "wheel", "audio" }; } diff --git a/src/modules/welcome/WelcomeViewStep.cpp b/src/modules/welcome/WelcomeViewStep.cpp index 1a43d4ef4..8534b808c 100644 --- a/src/modules/welcome/WelcomeViewStep.cpp +++ b/src/modules/welcome/WelcomeViewStep.cpp @@ -130,7 +130,7 @@ WelcomeViewStep::setConfigurationMap( const QVariantMap& configurationMap ) configurationMap.value( "requirements" ).type() == QVariant::Map ) m_requirementsChecker->setConfigurationMap( configurationMap.value( "requirements" ).toMap() ); else - cDebug() << "WARNING: no valid requirements map found in welcome " + cWarning() << "no valid requirements map found in welcome " "module configuration."; } From 3ae126f589e4a8ee9fb16f0dca7732e51c4d3cb8 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 13 Feb 2018 11:14:45 +0100 Subject: [PATCH 7/7] [modules] Use cError() as well - Switch KPMHelpers to using Calamares logging instead of qDebug() --- src/libcalamaresui/Branding.cpp | 2 +- src/modules/partition/core/KPMHelpers.cpp | 6 ++++-- src/modules/partition/core/PartUtils.cpp | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/libcalamaresui/Branding.cpp b/src/libcalamaresui/Branding.cpp index 5c4296491..5677f212e 100644 --- a/src/libcalamaresui/Branding.cpp +++ b/src/libcalamaresui/Branding.cpp @@ -291,7 +291,7 @@ Branding::setGlobals( GlobalStorage* globalStorage ) const void Branding::bail( const QString& message ) { - cLog() << "FATAL ERROR in" + cError() << "FATAL in" << m_descriptorPath << "\n" + message; ::exit( EXIT_FAILURE ); diff --git a/src/modules/partition/core/KPMHelpers.cpp b/src/modules/partition/core/KPMHelpers.cpp index cf97b4fc2..3f3134c5b 100644 --- a/src/modules/partition/core/KPMHelpers.cpp +++ b/src/modules/partition/core/KPMHelpers.cpp @@ -29,6 +29,8 @@ #include #include +#include "utils/Logger.h" + #include @@ -46,7 +48,7 @@ initKPMcore() QByteArray backendName = qgetenv( "KPMCORE_BACKEND" ); if ( !CoreBackendManager::self()->load( backendName.isEmpty() ? CoreBackendManager::defaultBackendName() : backendName ) ) { - qWarning() << "Failed to load backend plugin" << backendName; + cWarning() << "Failed to load backend plugin" << backendName; return false; } s_KPMcoreInited = true; @@ -155,7 +157,7 @@ createNewEncryptedPartition( PartitionNode* parent, ) ); if ( !fs ) { - qDebug() << "ERROR: cannot create LUKS filesystem. Giving up."; + cError() << "cannot create LUKS filesystem. Giving up."; return nullptr; } diff --git a/src/modules/partition/core/PartUtils.cpp b/src/modules/partition/core/PartUtils.cpp index a8e004979..775fcee66 100644 --- a/src/modules/partition/core/PartUtils.cpp +++ b/src/modules/partition/core/PartUtils.cpp @@ -281,11 +281,11 @@ runOsprober( PartitionCoreModule* core ) osprober.start(); if ( !osprober.waitForStarted() ) { - cDebug() << "ERROR: os-prober cannot start."; + cError() << "os-prober cannot start."; } else if ( !osprober.waitForFinished( 60000 ) ) { - cDebug() << "ERROR: os-prober timed out."; + cError() << "os-prober timed out."; } else {