diff options
-rw-r--r-- | lib/util/debug.c | 12 | ||||
-rw-r--r-- | lib/util/debug.h | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/util/debug.c b/lib/util/debug.c index 996efdff7e..c8a22149a2 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 eb2151fc51..fd2adcfded 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 |