[libcalamares] Drop generic cLog()
- Use cWarning or cError() for errors - Use cDebug(level) for other uses (but there aren't any)
This commit is contained in:
parent
ad6227ce21
commit
6bb72d173d
@ -54,7 +54,7 @@ public:
|
||||
for( auto job : m_jobs )
|
||||
{
|
||||
emitProgress();
|
||||
cLog() << "Starting job" << job->prettyName();
|
||||
cDebug() << "Starting job" << job->prettyName();
|
||||
connect( job.data(), &Job::progress, this, &JobThread::emitProgress );
|
||||
JobResult result = job->exec();
|
||||
if ( !result )
|
||||
|
@ -41,7 +41,7 @@ namespace Logger
|
||||
class DLLEXPORT CLog : public QDebug
|
||||
{
|
||||
public:
|
||||
CLog( unsigned int debugLevel = 0 );
|
||||
explicit CLog( unsigned int debugLevel );
|
||||
virtual ~CLog();
|
||||
|
||||
private:
|
||||
@ -79,7 +79,6 @@ namespace Logger
|
||||
DLLEXPORT void setupLogLevel( unsigned int level );
|
||||
}
|
||||
|
||||
#define cLog Logger::CLog
|
||||
#define cDebug Logger::CDebug
|
||||
#define cWarning() Logger::CDebug(Logger::LOGWARNING) << "WARNING:"
|
||||
#define cError() Logger::CDebug(Logger::LOGERROR) << "ERROR:"
|
||||
|
@ -150,9 +150,9 @@ ViewManager::insertViewStep( int before, ViewStep* step )
|
||||
void
|
||||
ViewManager::onInstallationFailed( const QString& message, const QString& details )
|
||||
{
|
||||
cLog() << "Installation failed:";
|
||||
cLog() << "- message:" << message;
|
||||
cLog() << "- details:" << details;
|
||||
cError() << "Installation failed:";
|
||||
cDebug() << "- message:" << message;
|
||||
cDebug() << "- details:" << details;
|
||||
|
||||
QMessageBox* msgBox = new QMessageBox();
|
||||
msgBox->setIcon( QMessageBox::Critical );
|
||||
@ -167,7 +167,7 @@ ViewManager::onInstallationFailed( const QString& message, const QString& detail
|
||||
msgBox->setInformativeText( text );
|
||||
|
||||
connect( msgBox, &QMessageBox::buttonClicked, qApp, &QApplication::quit );
|
||||
cLog() << "Calamares will quit when the dialog closes.";
|
||||
cDebug() << "Calamares will quit when the dialog closes.";
|
||||
msgBox->show();
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ PartitionModel::parent( const QModelIndex& child ) const
|
||||
return createIndex( row, 0, parentNode );
|
||||
++row;
|
||||
}
|
||||
cLog() << "No parent found!";
|
||||
cWarning() << "No parent found!";
|
||||
return QModelIndex();
|
||||
}
|
||||
|
||||
|
@ -57,21 +57,21 @@ Calamares::JobResult SetHostNameJob::exec()
|
||||
|
||||
if ( !gs || !gs->contains( "rootMountPoint" ) )
|
||||
{
|
||||
cLog() << "No rootMountPoint in global storage";
|
||||
cError() << "No rootMountPoint in global storage";
|
||||
return Calamares::JobResult::error( tr( "Internal Error" ) );
|
||||
}
|
||||
|
||||
QString destDir = gs->value( "rootMountPoint" ).toString();
|
||||
if ( !QDir( destDir ).exists() )
|
||||
{
|
||||
cLog() << "rootMountPoint points to a dir which does not exist";
|
||||
cError() << "rootMountPoint points to a dir which does not exist";
|
||||
return Calamares::JobResult::error( tr( "Internal Error" ) );
|
||||
}
|
||||
|
||||
QFile hostfile( destDir + "/etc/hostname" );
|
||||
if ( !hostfile.open( QFile::WriteOnly ) )
|
||||
{
|
||||
cLog() << "Can't write to hostname file";
|
||||
cError() << "Can't write to hostname file";
|
||||
return Calamares::JobResult::error( tr( "Cannot write hostname to target system" ) );
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ Calamares::JobResult SetHostNameJob::exec()
|
||||
QFile hostsfile( destDir + "/etc/hosts" );
|
||||
if ( !hostsfile.open( QFile::WriteOnly ) )
|
||||
{
|
||||
cLog() << "Can't write to hosts file";
|
||||
cError() << "Can't write to hosts file";
|
||||
return Calamares::JobResult::error( tr( "Cannot write hostname to target system" ) );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user