Index: python/py_debug.c =================================================================== --- python/py_debug.c (Revision 24235) +++ python/py_debug.c (Arbeitskopie) @@ -64,15 +64,23 @@ { char *logfile; int flush, function; + FILE * fd; + PyObject * file; if (!PyArg_ParseTuple(args, "sii", &logfile, &flush, &function)) { return NULL; } - univention_debug_init(logfile, (char)flush, (char)function); + fd = univention_debug_init(logfile, (char)flush, (char)function); - Py_INCREF(Py_None); - return Py_None; + if ( fd == NULL ) { + Py_RETURN_NONE; + } else { + + } + file = PyFile_FromFile( fd, logfile, "a+", NULL ); + + return file; } static PyObject *py_univention_debug_set_level(PyObject *self, PyObject *args) Index: debian/control =================================================================== --- debian/control (Revision 24235) +++ debian/control (Arbeitskopie) @@ -2,9 +2,8 @@ Section: univention Priority: optional Maintainer: Univention GmbH -Standards-Version: 3.5.5 +Standards-Version: 3.7.2 Build-Depends: debhelper (>= 7.0.50~), autoconf, automake, libtool, python-all-dev, python-support -XS-Python-Version: all Package: libunivention-debug1 Architecture: any Index: debian/rules =================================================================== --- debian/rules (Revision 24235) +++ debian/rules (Arbeitskopie) @@ -58,3 +58,4 @@ override_dh_auto_test: [ ! -x /usr/bin/ucslint ] || /usr/bin/ucslint + Index: include/univention/debug.h =================================================================== --- include/univention/debug.h (Revision 24235) +++ include/univention/debug.h (Arbeitskopie) @@ -102,7 +102,7 @@ /** * Initialize debugging library. */ -void univention_debug_init(const char *logfile, enum uv_debug_flag_flush flush, enum uv_debug_flag_function function); +FILE * univention_debug_init(const char *logfile, enum uv_debug_flag_flush flush, enum uv_debug_flag_function function); /** * Close old logfile and re-open it. */ Index: lib/debug.c =================================================================== --- lib/debug.c (Revision 24235) +++ lib/debug.c (Arbeitskopie) @@ -84,7 +84,7 @@ "( ALL ) : " }; -void univention_debug_init(const char *logfile, enum uv_debug_flag_flush flush, enum uv_debug_flag_function function) +FILE * univention_debug_init(const char *logfile, enum uv_debug_flag_flush flush, enum uv_debug_flag_function function) { int i; time_t t; @@ -97,7 +97,7 @@ univention_debug_level = malloc(DEBUG_MODUL_COUNT * sizeof(int)); if (univention_debug_level == NULL) { fprintf(stderr, "Could not initialize univention_debug!\n"); - return; + return NULL; } for (i=0; i