[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() );
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();
}
}

View File

@ -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() );

View File

@ -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;
}

View File

@ -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();

View File

@ -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" );
}
}

View File

@ -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 )

View File

@ -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;
}

View File

@ -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<ShellProcessJob>(); )

View File

@ -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." ) );
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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" };
}

View File

@ -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.";
}