Add debug output api's from lsa/spoolss modules to smb module. Patch
authorTim Potter <tpot@samba.org>
Tue, 29 Jul 2003 00:05:17 +0000 (00:05 +0000)
committerTim Potter <tpot@samba.org>
Tue, 29 Jul 2003 00:05:17 +0000 (00:05 +0000)
from Brett A. Funderburg.

source/python/py_smb.c

index af2949f708cb2a094c0feb3863104cb2753d08bc..bb84a337c93214f84add2cd96f2cbaa162047196 100644 (file)
@@ -343,6 +343,38 @@ static PyMethodDef smb_methods[] = {
        { "connect", (PyCFunction)py_smb_connect, METH_VARARGS | METH_KEYWORDS,
          "Connect to a host" },
 
+       /* Other stuff - this should really go into a samba config module
+          but for the moment let's leave it here. */
+
+       { "setup_logging", (PyCFunction)py_setup_logging, 
+         METH_VARARGS | METH_KEYWORDS, 
+         "Set up debug logging.\n"
+"\n"
+"Initialises Samba's debug logging system.  One argument is expected which\n"
+"is a boolean specifying whether debugging is interactive and sent to stdout\n"
+"or logged to a file.\n"
+"\n"
+"Example:\n"
+"\n"
+">>> smb.setup_logging(interactive = 1)" },
+
+       { "get_debuglevel", (PyCFunction)get_debuglevel, 
+         METH_VARARGS, 
+         "Set the current debug level.\n"
+"\n"
+"Example:\n"
+"\n"
+">>> smb.get_debuglevel()\n"
+"0" },
+
+       { "set_debuglevel", (PyCFunction)set_debuglevel, 
+         METH_VARARGS, 
+         "Get the current debug level.\n"
+"\n"
+"Example:\n"
+"\n"
+">>> smb.set_debuglevel(10)" },
+
        { NULL }
 };
 
@@ -401,5 +433,5 @@ void initsmb(void)
        py_samba_init();
 
        setup_logging("smb", True);
-       DEBUGLEVEL = 10;
+       DEBUGLEVEL = 3;
 }