[modules] Use new convenience logging methods across the board

This commit is contained in:
Adriaan de Groot 2018-02-13 11:07:12 +01:00
parent 3f77fb1d16
commit 3315df5df1
14 changed files with 33 additions and 32 deletions

View File

@ -65,7 +65,7 @@ NetInstallPage::readGroups( const QByteArray& yamlData )
YAML::Node groups = YAML::Load( yamlData.constData() ); YAML::Node groups = YAML::Load( yamlData.constData() );
if ( !groups.IsSequence() ) 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() ); Q_ASSERT( groups.IsSequence() );
m_groups = new PackageModel( groups ); m_groups = new PackageModel( groups );
CALAMARES_RETRANSLATE( CALAMARES_RETRANSLATE(
@ -88,7 +88,7 @@ NetInstallPage::dataIsHere( QNetworkReply* reply )
// even if the reply is corrupt or missing. // even if the reply is corrupt or missing.
if ( reply->error() != QNetworkReply::NoError ) 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() << " ..Netinstall reply error: " << reply->error();
cDebug() << " ..Request for url: " << reply->url().toString() << " failed with: " << reply->errorString(); 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)" ) ); 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() ) ) 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() << " ..Url: " << reply->url().toString();
cDebug() << " ..Headers: " << reply->rawHeaderList(); cDebug() << " ..Headers: " << reply->rawHeaderList();
ui->netinst_status->setText( tr( "Network Installation. (Disabled: Received invalid groups data)" ) ); ui->netinst_status->setText( tr( "Network Installation. (Disabled: Received invalid groups data)" ) );
@ -122,7 +122,7 @@ NetInstallPage::selectedPackages() const
return m_groups->getPackages(); return m_groups->getPackages();
else else
{ {
cDebug() << "WARNING: no netinstall groups are available."; cWarning() << "no netinstall groups are available.";
return PackageModel::PackageItemDataList(); return PackageModel::PackageItemDataList();
} }
} }

View File

@ -259,7 +259,7 @@ doReplacePartition( PartitionCoreModule* core,
if ( partition->roles().has( PartitionRole::Unallocated ) ) if ( partition->roles().has( PartitionRole::Unallocated ) )
{ {
newRoles = PartitionRole( PartitionRole::Primary ); newRoles = PartitionRole( PartitionRole::Primary );
cDebug() << "WARNING: selected partition is free space"; cWarning() << "selected partition is free space";
if ( partition->parent() ) if ( partition->parent() )
{ {
Partition* parent = dynamic_cast< Partition* >( partition->parent() ); Partition* parent = dynamic_cast< Partition* >( partition->parent() );

View File

@ -507,7 +507,7 @@ PartitionCoreModule::scanForEfiSystemPartitions()
KPMHelpers::findPartitions( devices, PartUtils::isEfiBootable ); KPMHelpers::findPartitions( devices, PartUtils::isEfiBootable );
if ( efiSystemPartitions.isEmpty() ) 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; m_efiSystemPartitions = efiSystemPartitions;
} }

View File

@ -567,7 +567,7 @@ ChoicePage::onLeave()
} }
else else
{ {
cDebug() << "ERROR: cannot set up EFI system partition.\nESP count:" cError() << "cannot set up EFI system partition.\nESP count:"
<< efiSystemPartitions.count() << "\nm_efiComboBox:" << efiSystemPartitions.count() << "\nm_efiComboBox:"
<< m_efiComboBox; << m_efiComboBox;
} }
@ -582,7 +582,7 @@ ChoicePage::onLeave()
if ( d_p ) if ( d_p )
m_core->setBootLoaderInstallPath( d_p->deviceNode() ); m_core->setBootLoaderInstallPath( d_p->deviceNode() );
else else
cDebug() << "WARNING: No device selected for bootloader."; cWarning() << "No device selected for bootloader.";
} }
else else
{ {
@ -1315,7 +1315,7 @@ ChoicePage::setupActions()
if ( isEfi && !efiSystemPartitionFound ) 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."; "DISABLING alongside and replace features.";
m_alongsideButton->hide(); m_alongsideButton->hide();
m_replaceButton->hide(); m_replaceButton->hide();

View File

@ -426,6 +426,7 @@ PartitionViewStep::onLeave()
if ( !message.isEmpty() ) if ( !message.isEmpty() )
{ {
cWarning() << message;
QMessageBox::warning( m_manualPartitionPage, QMessageBox::warning( m_manualPartitionPage,
message, message,
description ); description );
@ -535,7 +536,7 @@ PartitionViewStep::setConfigurationMap( const QVariantMap& configurationMap )
gs->insert( "defaultFileSystemType", typeString ); gs->insert( "defaultFileSystemType", typeString );
if ( FileSystem::typeForName( typeString ) == FileSystem::Unknown ) 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" ); gs->insert( "defaultFileSystemType", "ext4" );
} }
} }

View File

@ -126,7 +126,7 @@ ClearMountsJob::exec()
} }
} }
else 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 // Then we go looking for volume groups that use this device for physical volumes
process.start( "pvdisplay", { "-C", "--noheadings" } ); process.start( "pvdisplay", { "-C", "--noheadings" } );
@ -159,7 +159,7 @@ ClearMountsJob::exec()
} }
} }
else 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(); const QStringList cryptoDevices2 = getCryptoDevices();
for ( const QString &mapperPath : cryptoDevices2 ) for ( const QString &mapperPath : cryptoDevices2 )

View File

@ -115,7 +115,7 @@ PlasmaLnfViewStep::jobs() const
if ( !m_lnfPath.isEmpty() ) if ( !m_lnfPath.isEmpty() )
l.append( Calamares::job_ptr( new PlasmaLnfJob( m_lnfPath, m_themeId ) ) ); l.append( Calamares::job_ptr( new PlasmaLnfJob( m_lnfPath, m_themeId ) ) );
else else
cDebug() << "WARNING: no lnftool given for plasmalnf module."; cWarning() << "no lnftool given for plasmalnf module.";
} }
return l; return l;
} }
@ -128,7 +128,7 @@ PlasmaLnfViewStep::setConfigurationMap( const QVariantMap& configurationMap )
m_widget->setLnfPath( m_lnfPath ); m_widget->setLnfPath( m_lnfPath );
if ( m_lnfPath.isEmpty() ) 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" ); m_liveUser = CalamaresUtils::getString( configurationMap, "liveuser" );
@ -150,7 +150,7 @@ PlasmaLnfViewStep::setConfigurationMap( const QVariantMap& configurationMap )
allThemes.append( ThemeInfo( i.toString() ) ); allThemes.append( ThemeInfo( i.toString() ) );
if ( allThemes.length() == 1 ) if ( allThemes.length() == 1 )
cDebug() << "WARNING: only one theme enabled in plasmalnf"; cWarning() << "only one theme enabled in plasmalnf";
m_widget->setEnabledThemes( allThemes ); m_widget->setEnabledThemes( allThemes );
} }
else else
@ -163,7 +163,7 @@ PlasmaLnfViewStep::themeSelected( const QString& id )
m_themeId = id; m_themeId = id;
if ( m_lnfPath.isEmpty() ) if ( m_lnfPath.isEmpty() )
{ {
cDebug() << "WARNING: no lnftool given for plasmalnf module."; cWarning() << "no lnftool given for plasmalnf module.";
return; return;
} }
@ -175,17 +175,17 @@ PlasmaLnfViewStep::themeSelected( const QString& id )
if ( !lnftool.waitForStarted( 1000 ) ) if ( !lnftool.waitForStarted( 1000 ) )
{ {
cDebug() << "WARNING: could not start look-and-feel" << m_lnfPath; cWarning() << "could not start look-and-feel" << m_lnfPath;
return; return;
} }
if ( !lnftool.waitForFinished() ) if ( !lnftool.waitForFinished() )
{ {
cDebug() << "WARNING:" << m_lnfPath << "timed out."; cWarning() << m_lnfPath << "timed out.";
return; return;
} }
if ( ( lnftool.exitCode() == 0 ) && ( lnftool.exitStatus() == QProcess::NormalExit ) ) if ( ( lnftool.exitCode() == 0 ) && ( lnftool.exitStatus() == QProcess::NormalExit ) )
cDebug() << "Plasma look-and-feel applied" << id; cDebug() << "Plasma look-and-feel applied" << id;
else else
cDebug() << "WARNING: could not apply look-and-feel" << id; cWarning() << "could not apply look-and-feel" << id;
} }

View File

@ -58,7 +58,7 @@ ShellProcessJob::exec()
if ( ! m_commands || m_commands->isEmpty() ) if ( ! m_commands || m_commands->isEmpty() )
{ {
cDebug() << "WARNING: No commands to execute" << moduleInstanceKey(); cWarning() << "No commands to execute" << moduleInstanceKey();
return Calamares::JobResult::ok(); return Calamares::JobResult::ok();
} }
@ -81,7 +81,7 @@ ShellProcessJob::setConfigurationMap( const QVariantMap& configurationMap )
cDebug() << "ShellProcessJob: \"script\" contains no commands for" << moduleInstanceKey(); cDebug() << "ShellProcessJob: \"script\" contains no commands for" << moduleInstanceKey();
} }
else else
cDebug() << "WARNING: No script given for ShellProcessJob" << moduleInstanceKey(); cWarning() << "No script given for ShellProcessJob" << moduleInstanceKey();
} }
CALAMARES_PLUGIN_FACTORY_DEFINITION( ShellProcessJobFactory, registerPlugin<ShellProcessJob>(); ) CALAMARES_PLUGIN_FACTORY_DEFINITION( ShellProcessJobFactory, registerPlugin<ShellProcessJob>(); )

View File

@ -84,7 +84,7 @@ Calamares::JobResult TrackingInstallJob::exec()
if ( !timeout.isActive() ) 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." ), return Calamares::JobResult::error( tr( "Internal error in install-tracking." ),
tr( "HTTP request timed out." ) ); tr( "HTTP request timed out." ) );
} }

View File

@ -81,7 +81,7 @@ void TrackingPage::enableTrackingOption(TrackingType t, bool enabled)
group->hide(); group->hide();
} }
else else
cDebug() << "WARNING: unknown tracking option" << int(t); cWarning() << "unknown tracking option" << int(t);
} }
bool TrackingPage::getTrackingOption(TrackingType 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; cDebug() << "Tracking policy" << int(t) << "set to" << url;
} }
else else
cDebug() << "WARNING: unknown tracking option" << int(t); cWarning() << "unknown tracking option" << int(t);
} }
void TrackingPage::setGeneralPolicy( QString url ) void TrackingPage::setGeneralPolicy( QString url )
@ -162,5 +162,5 @@ void TrackingPage::setTrackingLevel(const QString& l)
if ( button != nullptr ) if ( button != nullptr )
button->setChecked( true ); button->setChecked( true );
else else
cDebug() << "WARNING: unknown default tracking level" << l; cWarning() << "unknown default tracking level" << l;
} }

View File

@ -282,7 +282,7 @@ DEFINE_CHECK_FUNC( libpwquality )
{ {
if ( !value.canConvert( QVariant::List ) ) if ( !value.canConvert( QVariant::List ) )
{ {
cDebug() << "WARNING: libpwquality settings is not a list"; cWarning() << "libpwquality settings is not a list";
return; return;
} }
@ -296,7 +296,7 @@ DEFINE_CHECK_FUNC( libpwquality )
QString option = v.toString(); QString option = v.toString();
int r = settings->set( option ); int r = settings->set( option );
if ( r ) if ( r )
cDebug() << " .. WARNING: unrecognized libpwquality setting" << option; cWarning() << "unrecognized libpwquality setting" << option;
else else
{ {
cDebug() << " .. libpwquality setting" << option; cDebug() << " .. libpwquality setting" << option;
@ -304,7 +304,7 @@ DEFINE_CHECK_FUNC( libpwquality )
} }
} }
else else
cDebug() << " .. WARNING: unrecognized libpwquality setting" << v; cWarning() << "unrecognized libpwquality setting" << v;
} }
/* Something actually added? */ /* Something actually added? */
@ -320,7 +320,7 @@ DEFINE_CHECK_FUNC( libpwquality )
{ {
int r = settings->check( s ); int r = settings->check( s );
if ( r < 0 ) if ( r < 0 )
cDebug() << "WARNING: libpwquality error" << r; cWarning() << "libpwquality error" << r;
else if ( r < settings->arbitrary_minimum_strength ) else if ( r < settings->arbitrary_minimum_strength )
cDebug() << "Password strength" << r << "too low"; cDebug() << "Password strength" << r << "too low";
return r >= settings->arbitrary_minimum_strength; return r >= settings->arbitrary_minimum_strength;

View File

@ -475,5 +475,5 @@ UsersPage::addPasswordCheck( const QString& key, const QVariant& value )
} }
#endif #endif
else else
cDebug() << "WARNING: Unknown password-check key" << key; cWarning() << "Unknown password-check key" << key;
} }

View File

@ -132,7 +132,7 @@ UsersViewStep::setConfigurationMap( const QVariantMap& configurationMap )
} }
else 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" }; m_defaultGroups = QStringList{ "lp", "video", "network", "storage", "wheel", "audio" };
} }

View File

@ -130,7 +130,7 @@ WelcomeViewStep::setConfigurationMap( const QVariantMap& configurationMap )
configurationMap.value( "requirements" ).type() == QVariant::Map ) configurationMap.value( "requirements" ).type() == QVariant::Map )
m_requirementsChecker->setConfigurationMap( configurationMap.value( "requirements" ).toMap() ); m_requirementsChecker->setConfigurationMap( configurationMap.value( "requirements" ).toMap() );
else else
cDebug() << "WARNING: no valid requirements map found in welcome " cWarning() << "no valid requirements map found in welcome "
"module configuration."; "module configuration.";
} }