Skip to content

Commit

Permalink
s4:param add log_level function to retrieve log level in Python code
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Ambach <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
  • Loading branch information
der-ambi committed Sep 14, 2016
1 parent e62ff6c commit 7ba50a2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions source4/param/pyparam.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,13 @@ static PyObject *py_lp_dump_a_parameter(PyObject *self, PyObject *args)

}

static PyObject *py_lp_log_level(PyObject *self, PyObject *unused)
{
int ret = DEBUGLEVEL_CLASS[DBGC_CLASS];
return PyInt_FromLong(ret);
}


static PyObject *py_samdb_url(PyObject *self, PyObject *unused)
{
struct loadparm_context *lp_ctx = PyLoadparmContext_AsLoadparmContext(self);
Expand Down Expand Up @@ -357,6 +364,8 @@ static PyMethodDef py_lp_ctx_methods[] = {
"Get the server role." },
{ "dump", py_lp_dump, METH_VARARGS,
"S.dump(stream, show_defaults=False)" },
{ "log_level", py_lp_log_level, METH_NOARGS,
"S.log_level() -> int\n Get the active log level" },
{ "dump_a_parameter", py_lp_dump_a_parameter, METH_VARARGS,
"S.dump_a_parameter(stream, name, service_name)" },
{ "samdb_url", py_samdb_url, METH_NOARGS,
Expand Down

0 comments on commit 7ba50a2

Please sign in to comment.