Merge branch 'sanitize-logging'
This commit is contained in:
commit
e9d9efce20
@ -89,7 +89,7 @@ CalamaresApplication::init()
|
||||
|
||||
CalamaresApplication::~CalamaresApplication()
|
||||
{
|
||||
cDebug( LOGVERBOSE ) << "Shutting down Calamares...";
|
||||
cDebug( Logger::LOGVERBOSE ) << "Shutting down Calamares...";
|
||||
|
||||
// if ( JobQueue::instance() )
|
||||
// JobQueue::instance()->stop();
|
||||
@ -98,7 +98,7 @@ CalamaresApplication::~CalamaresApplication()
|
||||
|
||||
// delete JobQueue::instance();
|
||||
|
||||
cDebug( LOGVERBOSE ) << "Finished shutdown.";
|
||||
cDebug( Logger::LOGVERBOSE ) << "Finished shutdown.";
|
||||
}
|
||||
|
||||
|
||||
@ -143,7 +143,7 @@ CalamaresApplication::initQmlPath()
|
||||
.absoluteFilePath( subpath ) );
|
||||
if ( !importPath.exists() || !importPath.isReadable() )
|
||||
{
|
||||
cLog() << "FATAL ERROR: explicitly configured application data directory"
|
||||
cError() << "FATAL: explicitly configured application data directory"
|
||||
<< CalamaresUtils::appDataDir().absolutePath()
|
||||
<< "does not contain a valid QML modules directory at"
|
||||
<< importPath.absolutePath()
|
||||
@ -176,7 +176,7 @@ CalamaresApplication::initQmlPath()
|
||||
|
||||
if ( !importPath.exists() || !importPath.isReadable() )
|
||||
{
|
||||
cLog() << "FATAL ERROR: none of the expected QML paths ("
|
||||
cError() << "FATAL: none of the expected QML paths ("
|
||||
<< qmlDirCandidatesByPriority.join( ", " )
|
||||
<< ") exist."
|
||||
<< "\nCowardly refusing to continue startup without the QML directory.";
|
||||
@ -197,7 +197,7 @@ CalamaresApplication::initSettings()
|
||||
settingsFile = QFileInfo( CalamaresUtils::appDataDir().absoluteFilePath( "settings.conf" ) );
|
||||
if ( !settingsFile.exists() || !settingsFile.isReadable() )
|
||||
{
|
||||
cLog() << "FATAL ERROR: explicitly configured application data directory"
|
||||
cError() << "FATAL: explicitly configured application data directory"
|
||||
<< CalamaresUtils::appDataDir().absolutePath()
|
||||
<< "does not contain a valid settings.conf file."
|
||||
<< "\nCowardly refusing to continue startup without settings.";
|
||||
@ -230,7 +230,7 @@ CalamaresApplication::initSettings()
|
||||
|
||||
if ( !settingsFile.exists() || !settingsFile.isReadable() )
|
||||
{
|
||||
cLog() << "FATAL ERROR: none of the expected configuration file paths ("
|
||||
cError() << "FATAL: none of the expected configuration file paths ("
|
||||
<< settingsFileCandidatesByPriority.join( ", " )
|
||||
<< ") contain a valid settings.conf file."
|
||||
<< "\nCowardly refusing to continue startup without settings.";
|
||||
@ -248,7 +248,7 @@ CalamaresApplication::initBranding()
|
||||
QString brandingComponentName = Calamares::Settings::instance()->brandingComponentName();
|
||||
if ( brandingComponentName.simplified().isEmpty() )
|
||||
{
|
||||
cLog() << "FATAL ERROR: branding component not set in settings.conf";
|
||||
cError() << "FATAL: branding component not set in settings.conf";
|
||||
::exit( EXIT_FAILURE );
|
||||
}
|
||||
|
||||
@ -262,7 +262,7 @@ CalamaresApplication::initBranding()
|
||||
.absoluteFilePath( brandingDescriptorSubpath ) );
|
||||
if ( !brandingFile.exists() || !brandingFile.isReadable() )
|
||||
{
|
||||
cLog() << "FATAL ERROR: explicitly configured application data directory"
|
||||
cError() << "FATAL: explicitly configured application data directory"
|
||||
<< CalamaresUtils::appDataDir().absolutePath()
|
||||
<< "does not contain a valid branding component descriptor at"
|
||||
<< brandingFile.absoluteFilePath()
|
||||
@ -299,7 +299,7 @@ CalamaresApplication::initBranding()
|
||||
|
||||
if ( !brandingFile.exists() || !brandingFile.isReadable() )
|
||||
{
|
||||
cLog() << "FATAL ERROR: none of the expected branding descriptor file paths ("
|
||||
cError() << "FATAL: none of the expected branding descriptor file paths ("
|
||||
<< brandingFileCandidatesByPriority.join( ", " )
|
||||
<< ") contain a valid branding.desc file."
|
||||
<< "\nCowardly refusing to continue startup without branding.";
|
||||
|
@ -63,11 +63,14 @@ main( int argc, char* argv[] )
|
||||
parser.setApplicationDescription( "Distribution-independent installer framework" );
|
||||
parser.addHelpOption();
|
||||
parser.addVersionOption();
|
||||
QCommandLineOption debugOption( QStringList() << "d" << "debug",
|
||||
"Verbose output for debugging purposes." );
|
||||
QCommandLineOption debugOption( QStringList{ "d", "debug"},
|
||||
"Also look in current directory for configuration. Implies -D." );
|
||||
parser.addOption( debugOption );
|
||||
|
||||
QCommandLineOption configOption( QStringList() << "c" << "config",
|
||||
parser.addOption( QCommandLineOption( QStringLiteral("D"),
|
||||
"Verbose output for debugging purposes." ) );
|
||||
|
||||
QCommandLineOption configOption( QStringList{ "c", "config"},
|
||||
"Configuration directory to use, for testing purposes.", "config" );
|
||||
parser.addOption( configOption );
|
||||
|
||||
|
@ -223,7 +223,7 @@ Helper::Helper( QObject* parent )
|
||||
}
|
||||
else
|
||||
{
|
||||
cDebug() << "WARNING: creating PythonHelper more than once. This is very bad.";
|
||||
cWarning() << "creating PythonHelper more than once. This is very bad.";
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ static CommandLine get_variant_object( const QVariantMap& m )
|
||||
|
||||
if ( !command.isEmpty() )
|
||||
return CommandLine( command, timeout );
|
||||
cDebug() << "WARNING Bad CommandLine element" << m;
|
||||
cWarning() << "Bad CommandLine element" << m;
|
||||
return CommandLine();
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ static CommandList_t get_variant_stringlist( const QVariantList& l )
|
||||
// Otherwise warning is already given
|
||||
}
|
||||
else
|
||||
cDebug() << "WARNING Bad CommandList element" << c << v.type() << v;
|
||||
cWarning() << "Bad CommandList element" << c << v.type() << v;
|
||||
++c;
|
||||
}
|
||||
return retl;
|
||||
@ -79,7 +79,7 @@ CommandList::CommandList::CommandList( const QVariant& v, bool doChroot, int tim
|
||||
if ( v_list.count() )
|
||||
append( get_variant_stringlist( v_list ) );
|
||||
else
|
||||
cDebug() << "WARNING: Empty CommandList";
|
||||
cWarning() << "Empty CommandList";
|
||||
}
|
||||
else if ( v.type() == QVariant::String )
|
||||
append( v.toString() );
|
||||
@ -91,7 +91,7 @@ CommandList::CommandList::CommandList( const QVariant& v, bool doChroot, int tim
|
||||
// Otherwise warning is already given
|
||||
}
|
||||
else
|
||||
cDebug() << "WARNING: CommandList does not understand variant" << v.type();
|
||||
cWarning() << "CommandList does not understand variant" << v.type();
|
||||
}
|
||||
|
||||
CommandList::~CommandList()
|
||||
@ -109,7 +109,7 @@ Calamares::JobResult CommandList::run()
|
||||
{
|
||||
if ( !gs || !gs->contains( "rootMountPoint" ) )
|
||||
{
|
||||
cDebug() << "ERROR: No rootMountPoint defined.";
|
||||
cError() << "No rootMountPoint defined.";
|
||||
return Calamares::JobResult::error( QCoreApplication::translate( "CommandList", "Could not run command." ),
|
||||
QCoreApplication::translate( "CommandList", "No rootMountPoint is defined, so command cannot be run in the target environment." ) );
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
*
|
||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||
* Copyright 2017, Adriaan de Groot <groot@kde.org>
|
||||
* Copyright 2017-2018, Adriaan de Groot <groot@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -34,13 +34,8 @@
|
||||
|
||||
#define LOGFILE_SIZE 1024 * 256
|
||||
|
||||
#define RELEASE_LEVEL_THRESHOLD 0
|
||||
#define DEBUG_LEVEL_THRESHOLD LOGEXTRA
|
||||
|
||||
using namespace std;
|
||||
|
||||
static ofstream logfile;
|
||||
static unsigned int s_threshold = 0;
|
||||
static std::ofstream logfile;
|
||||
static unsigned int s_threshold = 0; // Set to non-zero on first logging call
|
||||
static QMutex s_mutex;
|
||||
|
||||
namespace Logger
|
||||
@ -52,13 +47,14 @@ log( const char* msg, unsigned int debugLevel, bool toDisk = true )
|
||||
if ( !s_threshold )
|
||||
{
|
||||
if ( qApp->arguments().contains( "--debug" ) ||
|
||||
qApp->arguments().contains( "-d" ) )
|
||||
qApp->arguments().contains( "-d" ) ||
|
||||
qApp->arguments().contains( "-D" ) )
|
||||
s_threshold = LOGVERBOSE;
|
||||
else
|
||||
#ifdef QT_NO_DEBUG
|
||||
s_threshold = RELEASE_LEVEL_THRESHOLD;
|
||||
s_threshold = LOG_DISABLE;
|
||||
#else
|
||||
s_threshold = DEBUG_LEVEL_THRESHOLD;
|
||||
s_threshold = LOGEXTRA;
|
||||
#endif
|
||||
// Comparison is < threshold, below
|
||||
++s_threshold;
|
||||
@ -75,7 +71,7 @@ log( const char* msg, unsigned int debugLevel, bool toDisk = true )
|
||||
<< " - "
|
||||
<< QTime::currentTime().toString().toUtf8().data()
|
||||
<< " [" << QString::number( debugLevel ).toUtf8().data() << "]: "
|
||||
<< msg << endl;
|
||||
<< msg << std::endl;
|
||||
|
||||
logfile.flush();
|
||||
}
|
||||
@ -84,11 +80,10 @@ log( const char* msg, unsigned int debugLevel, bool toDisk = true )
|
||||
{
|
||||
QMutexLocker lock( &s_mutex );
|
||||
|
||||
cout << QTime::currentTime().toString().toUtf8().data()
|
||||
std::cout << QTime::currentTime().toString().toUtf8().data()
|
||||
<< " [" << QString::number( debugLevel ).toUtf8().data() << "]: "
|
||||
<< msg << endl;
|
||||
|
||||
cout.flush();
|
||||
<< msg << std::endl;
|
||||
std::cout.flush();
|
||||
}
|
||||
}
|
||||
|
||||
@ -155,7 +150,7 @@ setupLogfile()
|
||||
|
||||
cDebug() << "Using log file:" << logFile();
|
||||
|
||||
logfile.open( logFile().toLocal8Bit(), ios::app );
|
||||
logfile.open( logFile().toLocal8Bit(), std::ios::app );
|
||||
qInstallMessageHandler( CalamaresLogHandler );
|
||||
}
|
||||
|
||||
|
@ -25,13 +25,19 @@
|
||||
|
||||
#include "DllMacro.h"
|
||||
|
||||
#define LOGDEBUG 1
|
||||
#define LOGINFO 2
|
||||
#define LOGEXTRA 5
|
||||
#define LOGVERBOSE 8
|
||||
|
||||
namespace Logger
|
||||
{
|
||||
enum
|
||||
{
|
||||
LOG_DISABLE = 0,
|
||||
LOGERROR = 1,
|
||||
LOGWARNING = 2,
|
||||
LOGINFO = 3,
|
||||
LOGEXTRA = 5,
|
||||
LOGDEBUG = 6,
|
||||
LOGVERBOSE = 8
|
||||
} ;
|
||||
|
||||
class DLLEXPORT CLog : public QDebug
|
||||
{
|
||||
public:
|
||||
@ -59,5 +65,7 @@ namespace Logger
|
||||
|
||||
#define cLog Logger::CLog
|
||||
#define cDebug Logger::CDebug
|
||||
#define cWarning() Logger::CDebug(Logger::LOGWARNING) << "WARNING:"
|
||||
#define cError() Logger::CDebug(Logger::LOGERROR) << "ERROR:"
|
||||
|
||||
#endif // CALAMARES_LOGGER_H
|
||||
|
@ -179,12 +179,12 @@ Branding::Branding( const QString& brandingFilePath,
|
||||
}
|
||||
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" ) );
|
||||
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.append( QString( "%1calamares-%2" )
|
||||
.arg( QDir::separator() )
|
||||
@ -192,13 +192,13 @@ Branding::Branding( const QString& brandingFilePath,
|
||||
}
|
||||
else
|
||||
{
|
||||
cDebug() << "WARNING: Cannot read " << file.fileName();
|
||||
cWarning() << "Cannot read " << file.fileName();
|
||||
}
|
||||
|
||||
s_instance = this;
|
||||
if ( m_componentName.isEmpty() )
|
||||
{
|
||||
cDebug() << "WARNING: failed to load component from" << brandingFilePath;
|
||||
cWarning() << "Failed to load component from" << brandingFilePath;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -291,7 +291,7 @@ Branding::setGlobals( GlobalStorage* globalStorage ) const
|
||||
void
|
||||
Branding::bail( const QString& message )
|
||||
{
|
||||
cLog() << "FATAL ERROR in"
|
||||
cError() << "FATAL in"
|
||||
<< m_descriptorPath
|
||||
<< "\n" + message;
|
||||
::exit( EXIT_FAILURE );
|
||||
|
@ -156,12 +156,12 @@ Settings::Settings( const QString& settingsFilePath,
|
||||
}
|
||||
catch ( YAML::Exception& e )
|
||||
{
|
||||
cDebug() << "WARNING: YAML parser error " << e.what() << "in" << file.fileName();
|
||||
cWarning() << "YAML parser error " << e.what() << "in" << file.fileName();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cDebug() << "WARNING: Cannot read " << file.fileName();
|
||||
cWarning() << "Cannot read " << file.fileName();
|
||||
}
|
||||
|
||||
s_instance = this;
|
||||
|
@ -145,7 +145,7 @@ Module::fromDescriptor( const QVariantMap& moduleDescriptor,
|
||||
}
|
||||
catch ( YAML::Exception& e )
|
||||
{
|
||||
cDebug() << "WARNING: YAML parser error " << e.what();
|
||||
cWarning() << "YAML parser error " << e.what();
|
||||
delete m;
|
||||
return nullptr;
|
||||
}
|
||||
@ -197,8 +197,7 @@ Module::loadConfigurationFile( const QString& configFileName ) //throws YAML::Ex
|
||||
}
|
||||
if ( !doc.IsMap() )
|
||||
{
|
||||
cLog() << Q_FUNC_INFO << "bad module configuration format"
|
||||
<< path;
|
||||
cWarning() << "Bad module configuration format" << path;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ ModuleManager::doInit()
|
||||
}
|
||||
catch ( YAML::Exception& e )
|
||||
{
|
||||
cDebug() << "WARNING: YAML parser error " << e.what();
|
||||
cWarning() << "YAML parser error " << e.what();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -140,7 +140,7 @@ ModuleManager::doInit()
|
||||
}
|
||||
else
|
||||
{
|
||||
cDebug() << Q_FUNC_INFO << "cannot cd into module directory "
|
||||
cWarning() << "Cannot cd into module directory "
|
||||
<< path << "/" << subdir;
|
||||
}
|
||||
}
|
||||
@ -200,7 +200,7 @@ ModuleManager::loadModules()
|
||||
if ( moduleEntrySplit.length() < 1 ||
|
||||
moduleEntrySplit.length() > 2 )
|
||||
{
|
||||
cDebug() << "Wrong module entry format for module" << moduleEntry << "."
|
||||
cError() << "Wrong module entry format for module" << moduleEntry << "."
|
||||
<< "\nCalamares will now quit.";
|
||||
qApp->exit( 1 );
|
||||
return;
|
||||
@ -212,7 +212,7 @@ ModuleManager::loadModules()
|
||||
if ( !m_availableDescriptorsByModuleName.contains( moduleName ) ||
|
||||
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.";
|
||||
qApp->exit( 1 );
|
||||
return;
|
||||
@ -240,7 +240,7 @@ ModuleManager::loadModules()
|
||||
}
|
||||
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.";
|
||||
qApp->exit( 1 );
|
||||
return;
|
||||
@ -263,7 +263,7 @@ ModuleManager::loadModules()
|
||||
m_loadedModulesByInstanceKey.value( instanceKey, nullptr );
|
||||
if ( thisModule && !thisModule->isLoaded() )
|
||||
{
|
||||
cDebug() << "Module" << instanceKey << "exists but not loaded."
|
||||
cError() << "Module" << instanceKey << "exists but not loaded."
|
||||
<< "\nCalamares will now quit.";
|
||||
qApp->exit( 1 );
|
||||
return;
|
||||
@ -282,7 +282,7 @@ ModuleManager::loadModules()
|
||||
m_moduleDirectoriesByModuleName.value( moduleName ) );
|
||||
if ( !thisModule )
|
||||
{
|
||||
cDebug() << "Module" << instanceKey << "cannot be created from descriptor.";
|
||||
cWarning() << "Module" << instanceKey << "cannot be created from descriptor.";
|
||||
Q_ASSERT( thisModule );
|
||||
continue;
|
||||
}
|
||||
@ -292,7 +292,7 @@ ModuleManager::loadModules()
|
||||
Q_ASSERT( thisModule->isLoaded() );
|
||||
if ( !thisModule->isLoaded() )
|
||||
{
|
||||
cDebug() << "Module" << moduleName << "loading FAILED";
|
||||
cWarning() << "Module" << moduleName << "loading FAILED";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ yamlMapToVariant( const YAML::Node& mapNode )
|
||||
void
|
||||
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 ) )
|
||||
{
|
||||
// Try to show the line where it happened.
|
||||
@ -141,7 +141,7 @@ explainYamlException( const YAML::Exception& e, const QByteArray& yamlData, cons
|
||||
rangeend = rangestart + 40;
|
||||
|
||||
if ( linestart >= 0 )
|
||||
cDebug() << "WARNING: offending YAML data:" << yamlData.mid( rangestart, rangeend-rangestart ).constData();
|
||||
cWarning() << "offending YAML data:" << yamlData.mid( rangestart, rangeend-rangestart ).constData();
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ QWidget*
|
||||
PythonQtViewStep::widget()
|
||||
{
|
||||
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.";
|
||||
|
||||
bool nothingChanged = m_cxt.evalScript(
|
||||
|
@ -110,7 +110,7 @@ ContextualProcessJob::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
|
||||
if ( iter.value().type() != QVariant::Map )
|
||||
{
|
||||
cDebug() << "WARNING:" << moduleInstanceKey() << "bad configuration values for" << variableName;
|
||||
cWarning() << moduleInstanceKey() << "bad configuration values for" << variableName;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ ContextualProcessJob::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
QString valueString = valueiter.key();
|
||||
if ( variableName.isEmpty() )
|
||||
{
|
||||
cDebug() << "WARNING:" << moduleInstanceKey() << "variable" << variableName << "unrecognized value" << valueiter.key();
|
||||
cWarning() << moduleInstanceKey() << "variable" << variableName << "unrecognized value" << valueiter.key();
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -115,13 +115,13 @@ bool KeyBoardPreview::loadCodes() {
|
||||
process.start("ckbcomp", param);
|
||||
if (!process.waitForStarted())
|
||||
{
|
||||
cDebug() << "WARNING: ckbcomp not found , keyboard preview disabled";
|
||||
cWarning() << "ckbcomp not found , keyboard preview disabled";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!process.waitForFinished())
|
||||
{
|
||||
cDebug() << "WARNING: ckbcomp failed, keyboard preview disabled";
|
||||
cWarning() << "ckbcomp failed, keyboard preview disabled";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -346,7 +346,7 @@ LocalePage::init( const QString& initialRegion,
|
||||
|
||||
if ( m_localeGenLines.isEmpty() )
|
||||
{
|
||||
cDebug() << "WARNING: cannot acquire a list of available locales."
|
||||
cWarning() << "cannot acquire a list of available locales."
|
||||
<< "The locale and localecfg modules will be broken as long as this "
|
||||
"system does not provide"
|
||||
<< "\n\t "
|
||||
@ -454,7 +454,7 @@ LocalePage::guessLocaleConfiguration() const
|
||||
// If we cannot say anything about available locales
|
||||
if ( m_localeGenLines.isEmpty() )
|
||||
{
|
||||
cDebug() << "WARNING: guessLocaleConfiguration can't guess from an empty list.";
|
||||
cWarning() << "guessLocaleConfiguration can't guess from an empty list.";
|
||||
return LocaleConfiguration::createDefault();
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include <kpmcore/backend/corebackendmanager.h>
|
||||
#include <kpmcore/fs/luks.h>
|
||||
|
||||
#include "utils/Logger.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
@ -46,7 +48,7 @@ initKPMcore()
|
||||
QByteArray backendName = qgetenv( "KPMCORE_BACKEND" );
|
||||
if ( !CoreBackendManager::self()->load( backendName.isEmpty() ? CoreBackendManager::defaultBackendName() : backendName ) )
|
||||
{
|
||||
qWarning() << "Failed to load backend plugin" << backendName;
|
||||
cWarning() << "Failed to load backend plugin" << backendName;
|
||||
return false;
|
||||
}
|
||||
s_KPMcoreInited = true;
|
||||
@ -155,7 +157,7 @@ createNewEncryptedPartition( PartitionNode* parent,
|
||||
) );
|
||||
if ( !fs )
|
||||
{
|
||||
qDebug() << "ERROR: cannot create LUKS filesystem. Giving up.";
|
||||
cError() << "cannot create LUKS filesystem. Giving up.";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -281,11 +281,11 @@ runOsprober( PartitionCoreModule* core )
|
||||
osprober.start();
|
||||
if ( !osprober.waitForStarted() )
|
||||
{
|
||||
cDebug() << "ERROR: os-prober cannot start.";
|
||||
cError() << "os-prober cannot start.";
|
||||
}
|
||||
else if ( !osprober.waitForFinished( 60000 ) )
|
||||
{
|
||||
cDebug() << "ERROR: os-prober timed out.";
|
||||
cError() << "os-prober timed out.";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -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() );
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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" );
|
||||
}
|
||||
}
|
||||
|
@ -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 )
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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>(); )
|
||||
|
@ -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." ) );
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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" };
|
||||
}
|
||||
|
||||
|
@ -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.";
|
||||
}
|
||||
|
||||
|
@ -220,7 +220,7 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
}
|
||||
else
|
||||
{
|
||||
cDebug() << "WARNING: RequirementsChecker entry 'check' is incomplete.";
|
||||
cWarning() << "RequirementsChecker entry 'check' is incomplete.";
|
||||
incompleteConfiguration = true;
|
||||
}
|
||||
|
||||
@ -232,14 +232,14 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
}
|
||||
else
|
||||
{
|
||||
cDebug() << "WARNING: RequirementsChecker entry 'required' is incomplete.";
|
||||
cWarning() << "RequirementsChecker entry 'required' is incomplete.";
|
||||
incompleteConfiguration = true;
|
||||
}
|
||||
|
||||
// Help out with consistency, but don't fix
|
||||
for ( const auto& r : m_entriesToRequire )
|
||||
if ( !m_entriesToCheck.contains( r ) )
|
||||
cDebug() << "WARNING: RequirementsChecker requires" << r << "but does not check it.";
|
||||
cWarning() << "RequirementsChecker requires" << r << "but does not check it.";
|
||||
|
||||
if ( configurationMap.contains( "requiredStorage" ) &&
|
||||
( configurationMap.value( "requiredStorage" ).type() == QVariant::Double ||
|
||||
@ -249,7 +249,7 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
m_requiredStorageGB = configurationMap.value( "requiredStorage" ).toDouble( &ok );
|
||||
if ( !ok )
|
||||
{
|
||||
cDebug() << "WARNING: RequirementsChecker entry 'requiredStorage' is invalid.";
|
||||
cWarning() << "RequirementsChecker entry 'requiredStorage' is invalid.";
|
||||
m_requiredStorageGB = 3.;
|
||||
}
|
||||
|
||||
@ -257,7 +257,7 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
}
|
||||
else
|
||||
{
|
||||
cDebug() << "WARNING: RequirementsChecker entry 'requiredStorage' is missing.";
|
||||
cWarning() << "RequirementsChecker entry 'requiredStorage' is missing.";
|
||||
m_requiredStorageGB = 3.;
|
||||
incompleteConfiguration = true;
|
||||
}
|
||||
@ -270,14 +270,14 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
m_requiredRamGB = configurationMap.value( "requiredRam" ).toDouble( &ok );
|
||||
if ( !ok )
|
||||
{
|
||||
cDebug() << "WARNING: RequirementsChecker entry 'requiredRam' is invalid.";
|
||||
cWarning() << "RequirementsChecker entry 'requiredRam' is invalid.";
|
||||
m_requiredRamGB = 1.;
|
||||
incompleteConfiguration = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cDebug() << "WARNING: RequirementsChecker entry 'requiredRam' is missing.";
|
||||
cWarning() << "RequirementsChecker entry 'requiredRam' is missing.";
|
||||
m_requiredRamGB = 1.;
|
||||
incompleteConfiguration = true;
|
||||
}
|
||||
@ -289,7 +289,7 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
if ( m_checkHasInternetUrl.isEmpty() ||
|
||||
!QUrl( m_checkHasInternetUrl ).isValid() )
|
||||
{
|
||||
cDebug() << "WARNING: RequirementsChecker entry 'internetCheckUrl' is invalid in welcome.conf" << m_checkHasInternetUrl
|
||||
cWarning() << "RequirementsChecker entry 'internetCheckUrl' is invalid in welcome.conf" << m_checkHasInternetUrl
|
||||
<< "reverting to default (http://example.com).";
|
||||
m_checkHasInternetUrl = "http://example.com";
|
||||
incompleteConfiguration = true;
|
||||
@ -297,7 +297,7 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
}
|
||||
else
|
||||
{
|
||||
cDebug() << "WARNING: RequirementsChecker entry 'internetCheckUrl' is undefined in welcome.conf,"
|
||||
cWarning() << "RequirementsChecker entry 'internetCheckUrl' is undefined in welcome.conf,"
|
||||
"reverting to default (http://example.com).";
|
||||
|
||||
m_checkHasInternetUrl = "http://example.com";
|
||||
@ -305,7 +305,7 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
}
|
||||
|
||||
if ( incompleteConfiguration )
|
||||
cDebug() << "WARNING: RequirementsChecker configuration map:\n" << configurationMap;
|
||||
cWarning() << "RequirementsChecker configuration map:\n" << configurationMap;
|
||||
}
|
||||
|
||||
|
||||
@ -320,7 +320,7 @@ bool
|
||||
RequirementsChecker::checkEnoughStorage( qint64 requiredSpace )
|
||||
{
|
||||
#ifdef WITHOUT_LIBPARTED
|
||||
cDebug() << "WARNING: RequirementsChecker is configured without libparted.";
|
||||
cWarning() << "RequirementsChecker is configured without libparted.";
|
||||
return false;
|
||||
#else
|
||||
return check_big_enough( requiredSpace );
|
||||
|
Loading…
Reference in New Issue
Block a user