[libcalamares] Fix up debugging
Using plain cLog() is weird, it doesn't attach a debugging level so it seems like it's level 0, beyond-critical.
This commit is contained in:
parent
36ef4556b4
commit
73a5e0bbcd
@ -106,16 +106,16 @@ ProcessJob::callOutput( const QString& command,
|
||||
process.setWorkingDirectory( QDir( workingPath ).absolutePath() );
|
||||
else
|
||||
{
|
||||
cLog() << "Invalid working directory:" << workingPath;
|
||||
cWarning() << "Invalid working directory:" << workingPath;
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
|
||||
cLog() << "Running" << command;
|
||||
cDebug() << "Running" << command;
|
||||
process.start();
|
||||
if ( !process.waitForStarted() )
|
||||
{
|
||||
cLog() << "Process failed to start" << process.error();
|
||||
cWarning() << "Process failed to start" << process.error();
|
||||
return -2;
|
||||
}
|
||||
|
||||
@ -127,9 +127,9 @@ ProcessJob::callOutput( const QString& command,
|
||||
|
||||
if ( !process.waitForFinished( timeoutSec ? ( timeoutSec * 1000 ) : -1 ) )
|
||||
{
|
||||
cLog() << "Timed out. output so far:";
|
||||
cWarning() << "Timed out. output so far:";
|
||||
output.append( QString::fromLocal8Bit( process.readAllStandardOutput() ).trimmed() );
|
||||
cLog() << output;
|
||||
cWarning() << output;
|
||||
return -4;
|
||||
}
|
||||
|
||||
@ -137,11 +137,11 @@ ProcessJob::callOutput( const QString& command,
|
||||
|
||||
if ( process.exitStatus() == QProcess::CrashExit )
|
||||
{
|
||||
cLog() << "Process crashed";
|
||||
cWarning() << "Process crashed";
|
||||
return -1;
|
||||
}
|
||||
|
||||
cLog() << "Finished. Exit code:" << process.exitCode();
|
||||
cDebug() << "Finished. Exit code:" << process.exitCode();
|
||||
return process.exitCode();
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,7 @@ System::runCommand(
|
||||
if ( ( location == System::RunLocation::RunInTarget ) &&
|
||||
( !gs || !gs->contains( "rootMountPoint" ) ) )
|
||||
{
|
||||
cLog() << "No rootMountPoint in global storage";
|
||||
cWarning() << "No rootMountPoint in global storage";
|
||||
return -3;
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ System::runCommand(
|
||||
QString destDir = gs->value( "rootMountPoint" ).toString();
|
||||
if ( !QDir( destDir ).exists() )
|
||||
{
|
||||
cLog() << "rootMountPoint points to a dir which does not exist";
|
||||
cWarning() << "rootMountPoint points to a dir which does not exist";
|
||||
return -3;
|
||||
}
|
||||
|
||||
@ -153,15 +153,15 @@ System::runCommand(
|
||||
if ( QDir( workingPath ).exists() )
|
||||
process.setWorkingDirectory( QDir( workingPath ).absolutePath() );
|
||||
else
|
||||
cLog() << "Invalid working directory:" << workingPath;
|
||||
cWarning() << "Invalid working directory:" << workingPath;
|
||||
return -3;
|
||||
}
|
||||
|
||||
cLog() << "Running" << program << arguments;
|
||||
cDebug() << "Running" << program << arguments;
|
||||
process.start();
|
||||
if ( !process.waitForStarted() )
|
||||
{
|
||||
cLog() << "Process failed to start" << process.error();
|
||||
cWarning() << "Process failed to start" << process.error();
|
||||
return -2;
|
||||
}
|
||||
|
||||
@ -173,8 +173,8 @@ System::runCommand(
|
||||
|
||||
if ( !process.waitForFinished( timeoutSec ? ( timeoutSec * 1000 ) : -1 ) )
|
||||
{
|
||||
cLog() << "Timed out. output so far:";
|
||||
cLog() << process.readAllStandardOutput();
|
||||
cWarning() << "Timed out. output so far:\n" <<
|
||||
process.readAllStandardOutput();
|
||||
return -4;
|
||||
}
|
||||
|
||||
@ -182,16 +182,16 @@ System::runCommand(
|
||||
|
||||
if ( process.exitStatus() == QProcess::CrashExit )
|
||||
{
|
||||
cLog() << "Process crashed";
|
||||
cWarning() << "Process crashed";
|
||||
return -1;
|
||||
}
|
||||
|
||||
auto r = process.exitCode();
|
||||
cLog() << "Finished. Exit code:" << r;
|
||||
cDebug() << "Finished. Exit code:" << r;
|
||||
if ( r != 0 )
|
||||
{
|
||||
cLog() << "Target cmd:" << args;
|
||||
cLog().noquote() << "Target output:\n" << output;
|
||||
cDebug() << "Target cmd:" << args;
|
||||
cDebug().noquote() << "Target output:\n" << output;
|
||||
}
|
||||
return ProcessResult(r, output);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user