diff --git a/src/libcalamares/utils/CalamaresUtilsSystem.cpp b/src/libcalamares/utils/CalamaresUtilsSystem.cpp index ba0de827a..cb4bbd66a 100644 --- a/src/libcalamares/utils/CalamaresUtilsSystem.cpp +++ b/src/libcalamares/utils/CalamaresUtilsSystem.cpp @@ -174,7 +174,7 @@ System::runCommand( if ( !process.waitForFinished( timeoutSec ? ( timeoutSec * 1000 ) : -1 ) ) { - cWarning() << "Timed out. Output so far:\n" << + cWarning().noquote().nospace() << "Timed out. Output so far:\n" << process.readAllStandardOutput(); return -4; } @@ -183,7 +183,7 @@ System::runCommand( if ( process.exitStatus() == QProcess::CrashExit ) { - cWarning() << "Process crashed. Output so far:\n" << output; + cWarning().noquote().nospace() << "Process crashed. Output so far:\n" << output; return -1; } @@ -192,7 +192,7 @@ System::runCommand( if ( ( r != 0 ) || Calamares::Settings::instance()->debugMode() ) { cDebug() << "Target cmd:" << args; - cDebug().noquote() << "Target output:\n" << output; + cDebug().noquote().nospace() << "Target output:\n" << output; } return ProcessResult(r, output); } diff --git a/src/libcalamares/utils/Logger.h b/src/libcalamares/utils/Logger.h index 5db7253bb..f7488b553 100644 --- a/src/libcalamares/utils/Logger.h +++ b/src/libcalamares/utils/Logger.h @@ -56,6 +56,10 @@ namespace Logger public: CDebug( unsigned int debugLevel = LOGDEBUG ) : CLog( debugLevel ) { + if ( debugLevel <= LOGERROR ) + *this << "ERROR:"; + else if ( debugLevel <= LOGWARNING ) + *this << "WARNING:"; } virtual ~CDebug(); }; @@ -173,7 +177,7 @@ namespace Logger } #define cDebug Logger::CDebug -#define cWarning() Logger::CDebug(Logger::LOGWARNING) << "WARNING:" -#define cError() Logger::CDebug(Logger::LOGERROR) << "ERROR:" +#define cWarning() Logger::CDebug(Logger::LOGWARNING) +#define cError() Logger::CDebug(Logger::LOGERROR) #endif // CALAMARES_LOGGER_H