summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorChristian Ambach <ambi@samba.org>2016-09-13 10:48:03 +0200
committerStefan Metzmacher <metze@samba.org>2016-10-24 10:56:12 +0200
commitcfa3e0f415754c74d62268339711336b510522d5 (patch)
tree8ff0d3f0bd9ac9a816bab6887392e4ca5683dd1b /source4
parentad96251e7e2e0624219f93ed3f1fbe0b4df89985 (diff)
downloadsamba-cfa3e0f415754c74d62268339711336b510522d5.tar.gz
s4:param add log_level function to retrieve log level in Python code
Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 7ba50a200924119ac1a66759e4c1419ece03ba41)
Diffstat (limited to 'source4')
-rw-r--r--source4/param/pyparam.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c
index fde91e5886e..29fb9c483a4 100644
--- a/source4/param/pyparam.c
+++ b/source4/param/pyparam.c
@@ -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);
@@ -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,