[API CHANGE] Add a sal_debug method to pyuno

Does the obvious thing. Useful to get debug output from Python code at
development time into the same format and in the same output file as
from SAL_DEBUG() calls in C++ source code. Especially useful when
combined with SAL_LOG=+TIMESTAMP or +RELATIVETIMER.

Change-Id: I8c3d4fdf83b06846acb56773438401d467e71062
Reviewed-on: https://gerrit.libreoffice.org/56171
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/pyuno/source/module/pyuno_module.cxx b/pyuno/source/module/pyuno_module.cxx
index a50ca37..9fe1f07 100644
--- a/pyuno/source/module/pyuno_module.cxx
+++ b/pyuno/source/module/pyuno_module.cxx
@@ -823,6 +823,20 @@ static PyObject *setCurrentContext(
    return ret.getAcquired();
}

static PyObject *sal_debug(
    SAL_UNUSED_PARAMETER PyObject *, SAL_UNUSED_PARAMETER PyObject * args )
{
    Py_INCREF( Py_None );
    if( !PyTuple_Check( args ) || PyTuple_Size( args) != 1 )
        return Py_None;

    OUString line = pyString2ustring( PyTuple_GetItem( args, 0 ) );

    SAL_DEBUG(line.toUtf8().getStr());

    return Py_None;
}

}

struct PyMethodDef PyUNOModule_methods [] =
@@ -843,6 +857,7 @@ struct PyMethodDef PyUNOModule_methods [] =
    {"invoke", invoke, METH_VARARGS | METH_KEYWORDS, nullptr},
    {"setCurrentContext", setCurrentContext, METH_VARARGS, nullptr},
    {"getCurrentContext", getCurrentContext, METH_VARARGS, nullptr},
    {"sal_debug", sal_debug, METH_VARARGS, nullptr},
    {nullptr, nullptr, 0, nullptr}
};