diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-09-03 13:03:31 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-09-03 18:36:09 +1000 |
commit | 617bbd913dcd6335cfcee3db6d23e8d3262dd566 (patch) | |
tree | 152d12b80c0fa30a3dc64fdb6cd97924656bd7fa /source4/scripting/python/pyglue.c | |
parent | 348824da759a78b06e75d6ab7f8f85aa9912957c (diff) | |
download | samba-617bbd913dcd6335cfcee3db6d23e8d3262dd566.tar.gz samba-617bbd913dcd6335cfcee3db6d23e8d3262dd566.tar.bz2 samba-617bbd913dcd6335cfcee3db6d23e8d3262dd566.zip |
allow setting of the debug level in python from C
Diffstat (limited to 'source4/scripting/python/pyglue.c')
-rw-r--r-- | source4/scripting/python/pyglue.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source4/scripting/python/pyglue.c b/source4/scripting/python/pyglue.c index 79ee0ec388..42c04c1f38 100644 --- a/source4/scripting/python/pyglue.c +++ b/source4/scripting/python/pyglue.c @@ -93,6 +93,15 @@ static PyObject *py_unix2nttime(PyObject *self, PyObject *args) return PyInt_FromLong((uint64_t)nt); } +static PyObject *py_set_debug_level(PyObject *self, PyObject *args) +{ + unsigned level; + if (!PyArg_ParseTuple(args, "I", &level)) + return NULL; + (DEBUGLEVEL) = level; + Py_RETURN_NONE; +} + static PyObject *py_ldb_set_credentials(PyObject *self, PyObject *args) { PyObject *py_creds, *py_ldb; @@ -483,6 +492,8 @@ static PyMethodDef py_misc_methods[] = { NULL }, { "dom_sid_to_rid", (PyCFunction)py_dom_sid_to_rid, METH_VARARGS, NULL }, + { "set_debug_level", (PyCFunction)py_set_debug_level, METH_VARARGS, + "set debug level" }, { NULL } }; |