diff --git a/src/libcalamares/PythonJob.cpp b/src/libcalamares/PythonJob.cpp index 85a4aa739..7154b5d9d 100644 --- a/src/libcalamares/PythonJob.cpp +++ b/src/libcalamares/PythonJob.cpp @@ -42,6 +42,8 @@ BOOST_PYTHON_MODULE( libcalamares ) bp::scope().attr( "version" ) = CALAMARES_VERSION; bp::scope().attr( "shortVersion" ) = CALAMARES_VERSION_SHORT; + bp::def( "debug", &CalamaresPython::debug ); + bp::class_< CalamaresPython::PythonJobInterface >( "Job", bp::init< Calamares::PythonJob* >() ) .def_readonly( "prettyName", &CalamaresPython::PythonJobInterface::prettyName ) .def_readonly( "workingPath", &CalamaresPython::PythonJobInterface::workingPath ) diff --git a/src/libcalamares/PythonJobApi.cpp b/src/libcalamares/PythonJobApi.cpp index 179f8146b..fe7829f2a 100644 --- a/src/libcalamares/PythonJobApi.cpp +++ b/src/libcalamares/PythonJobApi.cpp @@ -19,10 +19,19 @@ #include "PythonJobApi.h" #include "PythonHelper.h" +#include "utils/Logger.h" namespace CalamaresPython { + +void +debug( const std::string& s ) +{ + cDebug() << "[PYTHON JOB]: " << QString::fromStdString( s ); +} + + PythonJobInterface::PythonJobInterface( Calamares::PythonJob* parent ) : m_parent( parent ) { diff --git a/src/libcalamares/PythonJobApi.h b/src/libcalamares/PythonJobApi.h index ff42c04d4..8c7eeae70 100644 --- a/src/libcalamares/PythonJobApi.h +++ b/src/libcalamares/PythonJobApi.h @@ -29,6 +29,8 @@ namespace CalamaresPython { +void debug( const std::string& s ); + class PythonJobInterface { public: