From f33c737e99e34f12f1de67d929edea87e341ff12 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 6 Apr 2020 11:56:39 +0200 Subject: [PATCH] [libcalamares] Pretty debug formatting - toggle nospace() and noquote() part-way through the line, so that they only affect the output obtained from the external command. --- src/libcalamares/utils/CalamaresUtilsSystem.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libcalamares/utils/CalamaresUtilsSystem.cpp b/src/libcalamares/utils/CalamaresUtilsSystem.cpp index f70de8ea2..651ac2c1e 100644 --- a/src/libcalamares/utils/CalamaresUtilsSystem.cpp +++ b/src/libcalamares/utils/CalamaresUtilsSystem.cpp @@ -195,7 +195,7 @@ System::runCommand( System::RunLocation location, ? ( static_cast< int >( std::chrono::milliseconds( timeoutSec ).count() ) ) : -1 ) ) { - cWarning().noquote().nospace() << "Process" << args.first() << "timed out. Output so far:\n" << process.readAllStandardOutput(); + ( cWarning() << "Process" << args.first() << "timed out after" << timeoutSec.count() << "s. Output so far:\n" ).noquote().nospace() << process.readAllStandardOutput(); return ProcessResult::Code::TimedOut; } @@ -203,7 +203,7 @@ System::runCommand( System::RunLocation location, if ( process.exitStatus() == QProcess::CrashExit ) { - cWarning().noquote().nospace() << "Process" << args.first() << "crashed. Output so far:\n" << output; + ( cWarning() << "Process" << args.first() << "crashed. Output so far:\n" ).noquote().nospace() << output; return ProcessResult::Code::Crashed; } @@ -212,8 +212,7 @@ System::runCommand( System::RunLocation location, bool showDebug = ( !Calamares::Settings::instance() ) || ( Calamares::Settings::instance()->debugMode() ); if ( ( r != 0 ) || showDebug ) { - cDebug() << "Target cmd:" << RedactedList( args ); - cDebug().noquote().nospace() << "Target output:\n" << output; + ( cDebug() << "Target cmd:" << RedactedList( args ) << "output:\n" ).noquote().nospace() << output; } return ProcessResult( r, output ); }