[libcalamares] [partition] Adjust to logging changes

- Use the un-paren'ed Continuation and SubEntry
This commit is contained in:
Adriaan de Groot 2019-04-15 08:15:17 -04:00
parent d72e3b3c22
commit 63b317902d
4 changed files with 22 additions and 22 deletions

View File

@ -44,7 +44,7 @@ requireString( const YAML::Node& config, const char* key )
return QString::fromStdString( v.as< std::string >() ); return QString::fromStdString( v.as< std::string >() );
else else
{ {
cWarning() << Logger::SubEntry() << "Required settings.conf key" << key << "is missing."; cWarning() << Logger::SubEntry << "Required settings.conf key" << key << "is missing.";
return QString(); return QString();
} }
} }
@ -58,7 +58,7 @@ requireBool( const YAML::Node& config, const char* key, bool d )
return v.as< bool >(); return v.as< bool >();
else else
{ {
cWarning() << Logger::SubEntry() << "Required settings.conf key" << key << "is missing."; cWarning() << Logger::SubEntry << "Required settings.conf key" << key << "is missing.";
return d; return d;
} }
} }
@ -106,7 +106,7 @@ interpretModulesSearch( const bool debugMode, const QStringList& rawPaths, QStri
output.append( d.absolutePath() ); output.append( d.absolutePath() );
} }
else else
cDebug() << Logger::SubEntry() << "module-search entry non-existent" << path; cDebug() << Logger::SubEntry << "module-search entry non-existent" << path;
} }
} }
} }

View File

@ -116,7 +116,7 @@ QList< Device* > getDevices( DeviceType which, qint64 minimumSize )
#ifdef DEBUG_PARTITION_UNSAFE #ifdef DEBUG_PARTITION_UNSAFE
cWarning() << "Allowing unsafe partitioning choices." << devices.count() << "candidates."; cWarning() << "Allowing unsafe partitioning choices." << devices.count() << "candidates.";
#ifdef DEBUG_PARTITION_LAME #ifdef DEBUG_PARTITION_LAME
cDebug() << Logger::SubEntry() << "it has been lamed, and will fail."; cDebug() << Logger::SubEntry << "it has been lamed, and will fail.";
#endif #endif
#else #else
cDebug() << "Removing unsuitable devices:" << devices.count() << "candidates."; cDebug() << "Removing unsuitable devices:" << devices.count() << "candidates.";
@ -125,29 +125,29 @@ QList< Device* > getDevices( DeviceType which, qint64 minimumSize )
for ( DeviceList::iterator it = devices.begin(); it != devices.end(); ) for ( DeviceList::iterator it = devices.begin(); it != devices.end(); )
if ( !( *it ) ) if ( !( *it ) )
{ {
cDebug() << Logger::SubEntry() << "Skipping nullptr device"; cDebug() << Logger::SubEntry << "Skipping nullptr device";
it = erase( devices, it); it = erase( devices, it);
} }
else if ( ( *it )->deviceNode().startsWith( "/dev/zram" ) else if ( ( *it )->deviceNode().startsWith( "/dev/zram" )
) )
{ {
cDebug() << Logger::SubEntry() << "Removing zram" << it; cDebug() << Logger::SubEntry << "Removing zram" << it;
it = erase( devices, it ); it = erase( devices, it );
} }
else if ( writableOnly && hasRootPartition( *it ) ) else if ( writableOnly && hasRootPartition( *it ) )
{ {
cDebug() << Logger::SubEntry() << "Removing device with root filesystem (/) on it" << it; cDebug() << Logger::SubEntry << "Removing device with root filesystem (/) on it" << it;
it = erase( devices, it ); it = erase( devices, it );
} }
else if ( writableOnly && isIso9660( *it ) ) else if ( writableOnly && isIso9660( *it ) )
{ {
cDebug() << Logger::SubEntry() << "Removing device with iso9660 filesystem (probably a CD) on it" << it; cDebug() << Logger::SubEntry << "Removing device with iso9660 filesystem (probably a CD) on it" << it;
it = erase( devices, it ); it = erase( devices, it );
} }
else if ( (minimumSize >= 0) && !( (*it)->capacity() > minimumSize ) ) else if ( (minimumSize >= 0) && !( (*it)->capacity() > minimumSize ) )
{ {
cDebug() << Logger::SubEntry() << "Removing too-small" << it; cDebug() << Logger::SubEntry << "Removing too-small" << it;
it = erase( devices, it ); it = erase( devices, it );
} }
else else

View File

@ -109,20 +109,20 @@ canBeResized( Partition* candidate )
if ( !candidate->fileSystem().supportGrow() || if ( !candidate->fileSystem().supportGrow() ||
!candidate->fileSystem().supportShrink() ) !candidate->fileSystem().supportShrink() )
{ {
cDebug() << Logger::SubEntry() << "NO, filesystem" << candidate->fileSystem().name() cDebug() << Logger::SubEntry << "NO, filesystem" << candidate->fileSystem().name()
<< "does not support resize."; << "does not support resize.";
return false; return false;
} }
if ( KPMHelpers::isPartitionFreeSpace( candidate ) ) if ( KPMHelpers::isPartitionFreeSpace( candidate ) )
{ {
cDebug() << Logger::SubEntry() << "NO, partition is free space"; cDebug() << Logger::SubEntry << "NO, partition is free space";
return false; return false;
} }
if ( candidate->isMounted() ) if ( candidate->isMounted() )
{ {
cDebug() << Logger::SubEntry() << "NO, partition is mounted"; cDebug() << Logger::SubEntry << "NO, partition is mounted";
return false; return false;
} }
@ -131,13 +131,13 @@ canBeResized( Partition* candidate )
PartitionTable* table = dynamic_cast< PartitionTable* >( candidate->parent() ); PartitionTable* table = dynamic_cast< PartitionTable* >( candidate->parent() );
if ( !table ) if ( !table )
{ {
cDebug() << Logger::SubEntry() << "NO, no partition table found"; cDebug() << Logger::SubEntry << "NO, no partition table found";
return false; return false;
} }
if ( table->numPrimaries() >= table->maxPrimaries() ) if ( table->numPrimaries() >= table->maxPrimaries() )
{ {
cDebug() << Logger::SubEntry() << "NO, partition table already has" cDebug() << Logger::SubEntry << "NO, partition table already has"
<< table->maxPrimaries() << "primary partitions."; << table->maxPrimaries() << "primary partitions.";
return false; return false;
} }
@ -164,10 +164,10 @@ canBeResized( Partition* candidate )
else if ( ok ) else if ( ok )
{ {
auto deb = cDebug(); auto deb = cDebug();
deb << Logger::SubEntry() << "NO, insufficient storage"; deb << Logger::SubEntry << "NO, insufficient storage";
deb << Logger::Continuation() << "Required storage B:" << advisedStorageB deb << Logger::Continuation << "Required storage B:" << advisedStorageB
<< QString( "(%1GB)" ).arg( advisedStorageGB ); << QString( "(%1GB)" ).arg( advisedStorageGB );
deb << Logger::Continuation() << "Available storage B:" << availableStorageB deb << Logger::Continuation << "Available storage B:" << availableStorageB
<< QString( "(%1GB)" ).arg( availableStorageB / 1024 / 1024 / 1024 ) << QString( "(%1GB)" ).arg( availableStorageB / 1024 / 1024 / 1024 )
<< "for" << convenienceName( candidate ) << " length:" << candidate->length() << "for" << convenienceName( candidate ) << " length:" << candidate->length()
<< " sectorsUsed:" << candidate->sectorsUsed() << " fsType:" << candidate->fileSystem().name(); << " sectorsUsed:" << candidate->sectorsUsed() << " fsType:" << candidate->fileSystem().name();
@ -175,7 +175,7 @@ canBeResized( Partition* candidate )
} }
else else
{ {
cDebug() << Logger::SubEntry() << "NO, requiredStorageGB is not set correctly."; cDebug() << Logger::SubEntry << "NO, requiredStorageGB is not set correctly.";
return false; return false;
} }
} }
@ -198,10 +198,10 @@ canBeResized( PartitionCoreModule* core, const QString& partitionPath )
return canBeResized( candidate ); return canBeResized( candidate );
} }
} }
cDebug() << Logger::SubEntry() << "no Partition* found for" << partitionWithOs; cDebug() << Logger::SubEntry << "no Partition* found for" << partitionWithOs;
} }
cDebug() << Logger::SubEntry() << "Partition" << partitionWithOs << "CANNOT BE RESIZED FOR AUTOINSTALL."; cDebug() << Logger::SubEntry << "Partition" << partitionWithOs << "CANNOT BE RESIZED FOR AUTOINSTALL.";
return false; return false;
} }

View File

@ -1238,12 +1238,12 @@ ChoicePage::setupActions()
{ {
if ( PartUtils::canBeResized( *it ) ) if ( PartUtils::canBeResized( *it ) )
{ {
cDebug() << Logger::SubEntry() << "contains resizable" << it; cDebug() << Logger::SubEntry << "contains resizable" << it;
atLeastOneCanBeResized = true; atLeastOneCanBeResized = true;
} }
if ( PartUtils::canBeReplaced( *it ) ) if ( PartUtils::canBeReplaced( *it ) )
{ {
cDebug() << Logger::SubEntry() << "contains replaceable" << it; cDebug() << Logger::SubEntry << "contains replaceable" << it;
atLeastOneCanBeReplaced = true; atLeastOneCanBeReplaced = true;
} }
if ( (*it)->isMounted() ) if ( (*it)->isMounted() )