[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:
Adriaan de Groot 2018-03-28 09:31:45 -04:00
parent ad6227ce21
commit 6bb72d173d
5 changed files with 11 additions and 12 deletions

View File

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

View File

@ -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:"

View File

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

View File

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

View File

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