summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-04-02 18:19:47 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-02 18:52:29 +1100
commitb81100c71059698dbf4f1aaae52df48f65836b8e (patch)
tree2f61e584c9ff53d42ecc53ca86efd41dae4af36d
parentfde50c633f3a48c8e63718903a77e2c1ecc12a55 (diff)
downloadsamba-b81100c71059698dbf4f1aaae52df48f65836b8e.tar.gz
samba-b81100c71059698dbf4f1aaae52df48f65836b8e.tar.bz2
samba-b81100c71059698dbf4f1aaae52df48f65836b8e.zip
debug: enable talloc logging
we want to ensure talloc warnings are printed in the log
-rw-r--r--lib/util/debug.c12
-rw-r--r--lib/util/debug.h3
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