[libcalamares] Factor out common string in Python logging

- enforce consistent [PYTHON JOB]
- use CDebug() constructor, because the convenience macro's
  introduce the function name -- that's the C++ function, so
  it isn't useful for logging.
This commit is contained in:
Adriaan de Groot 2021-07-27 16:01:32 +02:00
parent fc2286117d
commit 3596b48c7a

View File

@ -136,16 +136,18 @@ check_target_env_output( const bp::list& args, const std::string& stdin, int tim
return ec.second.toStdString();
}
static const char output_prefix[] = "[PYTHON JOB]:";
void
debug( const std::string& s )
{
Logger::CDebug( Logger::LOGDEBUG ) << "[PYTHON JOB]: " << QString::fromStdString( s );
Logger::CDebug( Logger::LOGDEBUG ) << output_prefix << QString::fromStdString( s );
}
void
warning( const std::string& s )
{
cWarning() << "[PYTHON JOB]: " << QString::fromStdString( s );
Logger::CDebug( Logger::LOGWARNING ) << output_prefix << QString::fromStdString( s );
}
PythonJobInterface::PythonJobInterface( Calamares::PythonJob* parent )
@ -168,7 +170,6 @@ PythonJobInterface::setprogress( qreal progress )
}
}
std::string
obscure( const std::string& string )
{