Kaydet (Commit) 03c14b83 authored tarafından Tor Lillqvist's avatar Tor Lillqvist Kaydeden (comit) Noel Grandin

[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/56171Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 6441c2f2
......@@ -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}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment