From b81100c71059698dbf4f1aaae52df48f65836b8e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 2 Apr 2010 18:19:47 +1100 Subject: [PATCH] debug: enable talloc logging we want to ensure talloc warnings are printed in the log --- lib/util/debug.c | 12 ++++++++++++ lib/util/debug.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/lib/util/debug.c b/lib/util/debug.c index 996efdff7e8..c8a22149a28 100644 --- a/lib/util/debug.c +++ b/lib/util/debug.c @@ -182,12 +182,24 @@ _PUBLIC_ void reopen_logs(void) } } +/* setup for logging of talloc warnings */ +static void talloc_log_fn(const char *msg) +{ + DEBUG(0,("%s", msg)); +} + +void debug_setup_talloc_log(void) +{ + talloc_set_log_fn(talloc_log_fn); +} + /** control the name of the logfile and whether logging will be to stdout, stderr or a file */ _PUBLIC_ void setup_logging(const char *prog_name, enum debug_logtype new_logtype) { + debug_setup_talloc_log(); if (state.logtype < new_logtype) { state.logtype = new_logtype; } diff --git a/lib/util/debug.h b/lib/util/debug.h index eb2151fc51e..fd2adcfdedf 100644 --- a/lib/util/debug.h +++ b/lib/util/debug.h @@ -141,4 +141,7 @@ _PUBLIC_ void dbgtext(const char *format, ...) PRINTF_ATTRIBUTE(1,2); struct _XFILE; extern struct _XFILE *dbf; +/* setup talloc logging */ +void debug_setup_talloc_log(void); + #endif -- 2.34.1