[libcalamaresui] Use new convenience logging methods

- Remove a few confusing Q_FUNCINFO
This commit is contained in:
Adriaan de Groot 2018-02-12 10:46:57 -05:00
parent df0d9dcb88
commit 60f440f72b
6 changed files with 20 additions and 21 deletions

View File

@ -179,12 +179,12 @@ Branding::Branding( const QString& brandingFilePath,
} }
catch ( YAML::Exception& e ) catch ( YAML::Exception& e )
{ {
cDebug() << "WARNING: YAML parser error " << e.what() << "in" << file.fileName(); cWarning() << "YAML parser error " << e.what() << "in" << file.fileName();
} }
QDir translationsDir( componentDir.filePath( "lang" ) ); QDir translationsDir( componentDir.filePath( "lang" ) );
if ( !translationsDir.exists() ) if ( !translationsDir.exists() )
cDebug() << "WARNING: the selected branding component does not ship translations."; cWarning() << "the selected branding component does not ship translations.";
m_translationsPathPrefix = translationsDir.absolutePath(); m_translationsPathPrefix = translationsDir.absolutePath();
m_translationsPathPrefix.append( QString( "%1calamares-%2" ) m_translationsPathPrefix.append( QString( "%1calamares-%2" )
.arg( QDir::separator() ) .arg( QDir::separator() )
@ -192,13 +192,13 @@ Branding::Branding( const QString& brandingFilePath,
} }
else else
{ {
cDebug() << "WARNING: Cannot read " << file.fileName(); cWarning() << "Cannot read " << file.fileName();
} }
s_instance = this; s_instance = this;
if ( m_componentName.isEmpty() ) if ( m_componentName.isEmpty() )
{ {
cDebug() << "WARNING: failed to load component from" << brandingFilePath; cWarning() << "Failed to load component from" << brandingFilePath;
} }
else else
{ {

View File

@ -156,12 +156,12 @@ Settings::Settings( const QString& settingsFilePath,
} }
catch ( YAML::Exception& e ) catch ( YAML::Exception& e )
{ {
cDebug() << "WARNING: YAML parser error " << e.what() << "in" << file.fileName(); cWarning() << "YAML parser error " << e.what() << "in" << file.fileName();
} }
} }
else else
{ {
cDebug() << "WARNING: Cannot read " << file.fileName(); cWarning() << "Cannot read " << file.fileName();
} }
s_instance = this; s_instance = this;

View File

@ -145,7 +145,7 @@ Module::fromDescriptor( const QVariantMap& moduleDescriptor,
} }
catch ( YAML::Exception& e ) catch ( YAML::Exception& e )
{ {
cDebug() << "WARNING: YAML parser error " << e.what(); cWarning() << "YAML parser error " << e.what();
delete m; delete m;
return nullptr; return nullptr;
} }
@ -197,8 +197,7 @@ Module::loadConfigurationFile( const QString& configFileName ) //throws YAML::Ex
} }
if ( !doc.IsMap() ) if ( !doc.IsMap() )
{ {
cLog() << Q_FUNC_INFO << "bad module configuration format" cWarning() << "Bad module configuration format" << path;
<< path;
return; return;
} }

View File

@ -116,7 +116,7 @@ ModuleManager::doInit()
} }
catch ( YAML::Exception& e ) catch ( YAML::Exception& e )
{ {
cDebug() << "WARNING: YAML parser error " << e.what(); cWarning() << "YAML parser error " << e.what();
continue; continue;
} }
} }
@ -140,7 +140,7 @@ ModuleManager::doInit()
} }
else else
{ {
cDebug() << Q_FUNC_INFO << "cannot cd into module directory " cWarning() << "Cannot cd into module directory "
<< path << "/" << subdir; << path << "/" << subdir;
} }
} }
@ -200,7 +200,7 @@ ModuleManager::loadModules()
if ( moduleEntrySplit.length() < 1 || if ( moduleEntrySplit.length() < 1 ||
moduleEntrySplit.length() > 2 ) moduleEntrySplit.length() > 2 )
{ {
cDebug() << "Wrong module entry format for module" << moduleEntry << "." cError() << "Wrong module entry format for module" << moduleEntry << "."
<< "\nCalamares will now quit."; << "\nCalamares will now quit.";
qApp->exit( 1 ); qApp->exit( 1 );
return; return;
@ -212,7 +212,7 @@ ModuleManager::loadModules()
if ( !m_availableDescriptorsByModuleName.contains( moduleName ) || if ( !m_availableDescriptorsByModuleName.contains( moduleName ) ||
m_availableDescriptorsByModuleName.value( moduleName ).isEmpty() ) m_availableDescriptorsByModuleName.value( moduleName ).isEmpty() )
{ {
cDebug() << "Module" << moduleName << "not found in module search paths." cError() << "Module" << moduleName << "not found in module search paths."
<< "\nCalamares will now quit."; << "\nCalamares will now quit.";
qApp->exit( 1 ); qApp->exit( 1 );
return; return;
@ -240,7 +240,7 @@ ModuleManager::loadModules()
} }
else //ought to be a custom instance, but cannot find instance entry else //ought to be a custom instance, but cannot find instance entry
{ {
cDebug() << "Custom instance" << moduleEntry << "not found in custom instances section." cError() << "Custom instance" << moduleEntry << "not found in custom instances section."
<< "\nCalamares will now quit."; << "\nCalamares will now quit.";
qApp->exit( 1 ); qApp->exit( 1 );
return; return;
@ -263,7 +263,7 @@ ModuleManager::loadModules()
m_loadedModulesByInstanceKey.value( instanceKey, nullptr ); m_loadedModulesByInstanceKey.value( instanceKey, nullptr );
if ( thisModule && !thisModule->isLoaded() ) if ( thisModule && !thisModule->isLoaded() )
{ {
cDebug() << "Module" << instanceKey << "exists but not loaded." cError() << "Module" << instanceKey << "exists but not loaded."
<< "\nCalamares will now quit."; << "\nCalamares will now quit.";
qApp->exit( 1 ); qApp->exit( 1 );
return; return;
@ -282,7 +282,7 @@ ModuleManager::loadModules()
m_moduleDirectoriesByModuleName.value( moduleName ) ); m_moduleDirectoriesByModuleName.value( moduleName ) );
if ( !thisModule ) if ( !thisModule )
{ {
cDebug() << "Module" << instanceKey << "cannot be created from descriptor."; cWarning() << "Module" << instanceKey << "cannot be created from descriptor.";
Q_ASSERT( thisModule ); Q_ASSERT( thisModule );
continue; continue;
} }
@ -292,7 +292,7 @@ ModuleManager::loadModules()
Q_ASSERT( thisModule->isLoaded() ); Q_ASSERT( thisModule->isLoaded() );
if ( !thisModule->isLoaded() ) if ( !thisModule->isLoaded() )
{ {
cDebug() << "Module" << moduleName << "loading FAILED"; cWarning() << "Module" << moduleName << "loading FAILED";
continue; continue;
} }
} }

View File

@ -111,7 +111,7 @@ yamlMapToVariant( const YAML::Node& mapNode )
void void
explainYamlException( const YAML::Exception& e, const QByteArray& yamlData, const char *label ) explainYamlException( const YAML::Exception& e, const QByteArray& yamlData, const char *label )
{ {
cDebug() << "WARNING: YAML error " << e.what() << "in" << label << '.'; cWarning() << "YAML error " << e.what() << "in" << label << '.';
if ( ( e.mark.line >= 0 ) && ( e.mark.column >= 0 ) ) if ( ( e.mark.line >= 0 ) && ( e.mark.column >= 0 ) )
{ {
// Try to show the line where it happened. // Try to show the line where it happened.
@ -141,7 +141,7 @@ explainYamlException( const YAML::Exception& e, const QByteArray& yamlData, cons
rangeend = rangestart + 40; rangeend = rangestart + 40;
if ( linestart >= 0 ) if ( linestart >= 0 )
cDebug() << "WARNING: offending YAML data:" << yamlData.mid( rangestart, rangeend-rangestart ).constData(); cWarning() << "offending YAML data:" << yamlData.mid( rangestart, rangeend-rangestart ).constData();
} }
} }

View File

@ -80,7 +80,7 @@ QWidget*
PythonQtViewStep::widget() PythonQtViewStep::widget()
{ {
if ( m_widget->layout()->count() > 1 ) if ( m_widget->layout()->count() > 1 )
cDebug() << "WARNING: PythonQtViewStep wrapper widget has more than 1 child. " cWarning() << "PythonQtViewStep wrapper widget has more than 1 child. "
"This should never happen."; "This should never happen.";
bool nothingChanged = m_cxt.evalScript( bool nothingChanged = m_cxt.evalScript(