From 1b75475ade962f7a61db0fc1aacca9d9daa48861 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 21 Feb 2013 08:35:50 +0100 Subject: s4:lib/events: make use of samba_tevent_set_debug() Signed-off-by: Stefan Metzmacher Reviewed-by: Michael Adam --- source4/lib/events/tevent_s4.c | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) (limited to 'source4/lib/events') diff --git a/source4/lib/events/tevent_s4.c b/source4/lib/events/tevent_s4.c index 6770dd07af..f80424f71f 100644 --- a/source4/lib/events/tevent_s4.c +++ b/source4/lib/events/tevent_s4.c @@ -20,40 +20,6 @@ #define TEVENT_DEPRECATED 1 #include "lib/events/events.h" -/* - this is used to catch debug messages from events -*/ -static void ev_wrap_debug(void *context, enum tevent_debug_level level, - const char *fmt, va_list ap) PRINTF_ATTRIBUTE(3,0); - -static void ev_wrap_debug(void *context, enum tevent_debug_level level, - const char *fmt, va_list ap) -{ - int samba_level = -1; - char *s = NULL; - switch (level) { - case TEVENT_DEBUG_FATAL: - samba_level = 0; - break; - case TEVENT_DEBUG_ERROR: - samba_level = 1; - break; - case TEVENT_DEBUG_WARNING: - samba_level = 2; - break; - case TEVENT_DEBUG_TRACE: - samba_level = 50; - break; - - }; - if (CHECK_DEBUGLVL(samba_level)) { - vasprintf(&s, fmt, ap); - if (!s) return; - DEBUG(samba_level, ("tevent: %s", s)); - free(s); - } -} - /* create a event_context structure. This must be the first events call, and all subsequent calls pass this event_context as the first @@ -67,7 +33,7 @@ struct tevent_context *s4_event_context_init(TALLOC_CTX *mem_ctx) ev = tevent_context_init_byname(mem_ctx, NULL); if (ev) { - tevent_set_debug(ev, ev_wrap_debug, NULL); + samba_tevent_set_debug(ev, "s4_tevent"); tevent_loop_allow_nesting(ev); } return ev; -- cgit