mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-23 23:48:22 -04:00
[libcalamares] Make running commands less chatty
If there's no output, don't mention it; don't mention failure modes if the command was successful.
This commit is contained in:
parent
c963d8905f
commit
132ff59d9c
1 changed files with 21 additions and 4 deletions
|
@ -201,13 +201,30 @@ System::runCommand( System::RunLocation location,
|
|||
}
|
||||
|
||||
auto r = process.exitCode();
|
||||
cDebug() << Logger::SubEntry << "Finished. Exit code:" << r;
|
||||
bool showDebug = ( !Calamares::Settings::instance() ) || ( Calamares::Settings::instance()->debugMode() );
|
||||
if ( ( r != 0 ) || showDebug )
|
||||
if ( r == 0 )
|
||||
{
|
||||
cDebug() << Logger::SubEntry << "Target cmd:" << RedactedList( args ) << "output:\n"
|
||||
if ( showDebug && !output.isEmpty() )
|
||||
{
|
||||
cDebug() << Logger::SubEntry << "Finished. Exit code:" << r << "output:\n" << Logger::NoQuote {} << output;
|
||||
}
|
||||
else
|
||||
{
|
||||
cDebug() << Logger::SubEntry << "Finished. Exit code:" << r;
|
||||
}
|
||||
}
|
||||
else // if ( r != 0 )
|
||||
{
|
||||
if ( !output.isEmpty() )
|
||||
{
|
||||
cDebug() << Logger::SubEntry << "Target cmd:" << RedactedList( args ) << "Exit code:" << r << "output:\n"
|
||||
<< Logger::NoQuote {} << output;
|
||||
}
|
||||
else
|
||||
{
|
||||
cDebug() << Logger::SubEntry << "Target cmd:" << RedactedList( args ) << "Exit code:" << r << "(no output)";
|
||||
}
|
||||
}
|
||||
return ProcessResult( r, output );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue