View | Details | Raw Unified | Return to bug 22552
Collapse All | Expand All

(-)python/py_debug.c (-3 / +11 lines)
Lines 64-78 Link Here
64
{
64
{
65
    char *logfile;
65
    char *logfile;
66
    int flush, function;
66
    int flush, function;
67
    FILE * fd;
68
    PyObject * file;
67
69
68
    if (!PyArg_ParseTuple(args, "sii", &logfile, &flush, &function)) {
70
    if (!PyArg_ParseTuple(args, "sii", &logfile, &flush, &function)) {
69
        return NULL;
71
        return NULL;
70
    }
72
    }
71
73
72
    univention_debug_init(logfile, (char)flush, (char)function);
74
    fd = univention_debug_init(logfile, (char)flush, (char)function);
73
75
74
    Py_INCREF(Py_None);
76
    if ( fd == NULL ) {
75
    return Py_None;
77
        Py_RETURN_NONE;
78
    } else {
79
80
    }
81
    file = PyFile_FromFile( fd, logfile, "a+", NULL );
82
83
    return file;
76
}
84
}
77
85
78
static PyObject *py_univention_debug_set_level(PyObject *self, PyObject *args)
86
static PyObject *py_univention_debug_set_level(PyObject *self, PyObject *args)
(-)debian/control (-2 / +1 lines)
Lines 2-10 Link Here
2
Section: univention
2
Section: univention
3
Priority: optional
3
Priority: optional
4
Maintainer: Univention GmbH <packages@univention.de>
4
Maintainer: Univention GmbH <packages@univention.de>
5
Standards-Version: 3.5.5
5
Standards-Version: 3.7.2
6
Build-Depends: debhelper (>= 7.0.50~), autoconf, automake, libtool, python-all-dev, python-support
6
Build-Depends: debhelper (>= 7.0.50~), autoconf, automake, libtool, python-all-dev, python-support
7
XS-Python-Version: all
8
7
9
Package: libunivention-debug1
8
Package: libunivention-debug1
10
Architecture: any
9
Architecture: any
(-)debian/rules (+1 lines)
Lines 58-60 Link Here
58
58
59
override_dh_auto_test:
59
override_dh_auto_test:
60
	[ ! -x /usr/bin/ucslint ] || /usr/bin/ucslint
60
	[ ! -x /usr/bin/ucslint ] || /usr/bin/ucslint
61
(-)include/univention/debug.h (-1 / +1 lines)
Lines 102-108 Link Here
102
/**
102
/**
103
 * Initialize debugging library.
103
 * Initialize debugging library.
104
 */
104
 */
105
void univention_debug_init(const char *logfile, enum uv_debug_flag_flush flush, enum uv_debug_flag_function function);
105
FILE * univention_debug_init(const char *logfile, enum uv_debug_flag_flush flush, enum uv_debug_flag_function function);
106
/**
106
/**
107
 * Close old logfile and re-open it.
107
 * Close old logfile and re-open it.
108
 */
108
 */
(-)lib/debug.c (-3 / +5 lines)
Lines 84-90 Link Here
84
	"( ALL     ) : "
84
	"( ALL     ) : "
85
};
85
};
86
86
87
void univention_debug_init(const char *logfile, enum uv_debug_flag_flush flush, enum uv_debug_flag_function function)
87
FILE * univention_debug_init(const char *logfile, enum uv_debug_flag_flush flush, enum uv_debug_flag_function function)
88
{
88
{
89
	int i;
89
	int i;
90
	time_t t;
90
	time_t t;
Lines 97-103 Link Here
97
	univention_debug_level = malloc(DEBUG_MODUL_COUNT * sizeof(int));
97
	univention_debug_level = malloc(DEBUG_MODUL_COUNT * sizeof(int));
98
	if (univention_debug_level == NULL) {
98
	if (univention_debug_level == NULL) {
99
		fprintf(stderr, "Could not initialize univention_debug!\n");
99
		fprintf(stderr, "Could not initialize univention_debug!\n");
100
		return;
100
		return NULL;
101
	}
101
	}
102
102
103
	for (i=0; i<DEBUG_MODUL_COUNT; i++) {
103
	for (i=0; i<DEBUG_MODUL_COUNT; i++) {
Lines 113-119 Link Here
113
			free(univention_debug_level);
113
			free(univention_debug_level);
114
			univention_debug_level = NULL;
114
			univention_debug_level = NULL;
115
			fprintf(stderr, "Could not open logfile \"%s\"\n", univention_debug_filename);
115
			fprintf(stderr, "Could not open logfile \"%s\"\n", univention_debug_filename);
116
			return /*1*/;
116
			return NULL;
117
		}
117
		}
118
	}
118
	}
119
119
Lines 127-132 Link Here
127
	fflush(univention_debug_file);
127
	fflush(univention_debug_file);
128
128
129
	univention_debug_ready = true;
129
	univention_debug_ready = true;
130
131
	return univention_debug_file;
130
}
132
}
131
133
132
void univention_debug(enum uv_debug_category id, enum uv_debug_level level, const char *fmt, ...)
134
void univention_debug(enum uv_debug_category id, enum uv_debug_level level, const char *fmt, ...)

Return to bug 22552