diff --git a/src/libcalamares/PythonJobApi.cpp b/src/libcalamares/PythonJobApi.cpp index 1713569a4..b1ff536be 100644 --- a/src/libcalamares/PythonJobApi.cpp +++ b/src/libcalamares/PythonJobApi.cpp @@ -139,17 +139,28 @@ check_target_env_output( const bp::list& args, const std::string& stdin, int tim } static const char output_prefix[] = "[PYTHON JOB]:"; +static inline void +log_action( unsigned int level, const std::string& s ) +{ + Logger::CDebug( level ) << output_prefix << QString::fromStdString( s ); +} void debug( const std::string& s ) { - Logger::CDebug( Logger::LOGDEBUG ) << output_prefix << QString::fromStdString( s ); + log_action( Logger::LOGDEBUG, s ); } void warning( const std::string& s ) { - Logger::CDebug( Logger::LOGWARNING ) << output_prefix << QString::fromStdString( s ); + log_action( Logger::LOGWARNING, s ); +} + +void +error( const std::string& s ) +{ + log_action( Logger::LOGERROR, s ); } PythonJobInterface::PythonJobInterface( Calamares::PythonJob* parent ) diff --git a/src/libcalamares/PythonJobApi.h b/src/libcalamares/PythonJobApi.h index 48bd4f87c..0ecc43abd 100644 --- a/src/libcalamares/PythonJobApi.h +++ b/src/libcalamares/PythonJobApi.h @@ -60,6 +60,7 @@ boost::python::list gettext_languages(); void debug( const std::string& s ); void warning( const std::string& s ); +void error( const std::string& s ); class PythonJobInterface {