diff options
author | Stefan Metzmacher <metze@samba.org> | 2013-02-21 08:39:05 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2013-02-28 12:13:10 +0100 |
commit | 64d98c532357c71f27bd84539b3f7a14fd0f952b (patch) | |
tree | 98aec860316fe468ecffef930f45ef3e883710c4 /source3 | |
parent | 1b75475ade962f7a61db0fc1aacca9d9daa48861 (diff) | |
download | samba-64d98c532357c71f27bd84539b3f7a14fd0f952b.tar.gz samba-64d98c532357c71f27bd84539b3f7a14fd0f952b.tar.bz2 samba-64d98c532357c71f27bd84539b3f7a14fd0f952b.zip |
s3: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 'source3')
-rw-r--r-- | source3/lib/events.c | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/source3/lib/events.c b/source3/lib/events.c index 3b7794b0dd..0a8039ac6e 100644 --- a/source3/lib/events.c +++ b/source3/lib/events.c @@ -414,41 +414,6 @@ static bool s3_tevent_init(void) return initialized; } -/* - this is used to catch debug messages from events -*/ -static void s3_event_debug(void *context, enum tevent_debug_level level, - const char *fmt, va_list ap) PRINTF_ATTRIBUTE(3,0); - -static void s3_event_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 = 11; - break; - - }; - if (CHECK_DEBUGLVL(samba_level)) { - if (vasprintf(&s, fmt, ap) == -1) { - return; - } - DEBUG(samba_level, ("s3_event: %s", s)); - free(s); - } -} - struct tevent_context *s3_tevent_context_init(TALLOC_CTX *mem_ctx) { struct tevent_context *ev; @@ -457,7 +422,7 @@ struct tevent_context *s3_tevent_context_init(TALLOC_CTX *mem_ctx) ev = tevent_context_init_byname(mem_ctx, "s3"); if (ev) { - tevent_set_debug(ev, s3_event_debug, NULL); + samba_tevent_set_debug(ev, "s3_tevent"); } return ev; |