summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-02-21 08:35:50 +0100
committerMichael Adam <obnox@samba.org>2013-02-28 12:12:36 +0100
commit1b75475ade962f7a61db0fc1aacca9d9daa48861 (patch)
tree221360491b4f0bbb78e27847dfee15e871bfdeeb /source4
parent6b948cf54b75ac44c4857e8da8f7db251e00b67b (diff)
downloadsamba-1b75475ade962f7a61db0fc1aacca9d9daa48861.tar.gz
samba-1b75475ade962f7a61db0fc1aacca9d9daa48861.tar.bz2
samba-1b75475ade962f7a61db0fc1aacca9d9daa48861.zip
s4:lib/events: make use of samba_tevent_set_debug()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/events/tevent_s4.c36
1 files changed, 1 insertions, 35 deletions
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
@@ -21,40 +21,6 @@
#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
element. Event handlers also receive this as their first argument.
@@ -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;