diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-09-21 15:24:14 -0700 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-09-21 15:27:05 -0700 |
commit | 97ffb912c164e94728e5d3f82d602bb086bf65a4 (patch) | |
tree | dabedef7d3f6d8da633d9321ee07806f5c63e20f /source4/lib/ldb/common/ldb_debug.c | |
parent | 5b684bbfd761924360c08a32d657a33bc92b8f9c (diff) | |
download | samba-97ffb912c164e94728e5d3f82d602bb086bf65a4.tar.gz samba-97ffb912c164e94728e5d3f82d602bb086bf65a4.tar.xz samba-97ffb912c164e94728e5d3f82d602bb086bf65a4.zip |
s4-ldb: add a LDB_FLG_ENABLE_TRACING for full ldb tracing
When LDB_FLG_ENABLE_TRACING is set ldb will send full traces
of all operations and results
Diffstat (limited to 'source4/lib/ldb/common/ldb_debug.c')
-rw-r--r-- | source4/lib/ldb/common/ldb_debug.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source4/lib/ldb/common/ldb_debug.c b/source4/lib/ldb/common/ldb_debug.c index 7680862c2cd..4612b016f6b 100644 --- a/source4/lib/ldb/common/ldb_debug.c +++ b/source4/lib/ldb/common/ldb_debug.c @@ -60,6 +60,15 @@ static void ldb_debug_stderr(void *context, enum ldb_debug_level level, } } +static void ldb_debug_stderr_all(void *context, enum ldb_debug_level level, + const char *fmt, va_list ap) PRINTF_ATTRIBUTE(3,0); +static void ldb_debug_stderr_all(void *context, enum ldb_debug_level level, + const char *fmt, va_list ap) +{ + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); +} + /* convenience function to setup debug messages on stderr messages of level LDB_DEBUG_WARNING and higher are printed @@ -76,7 +85,11 @@ void ldb_debug(struct ldb_context *ldb, enum ldb_debug_level level, const char * { va_list ap; if (ldb->debug_ops.debug == NULL) { - ldb_set_debug_stderr(ldb); + if (ldb->flags & LDB_FLG_ENABLE_TRACING) { + ldb_set_debug(ldb, ldb_debug_stderr_all, ldb); + } else { + ldb_set_debug_stderr(ldb); + } } va_start(ap, fmt); ldb->debug_ops.debug(ldb->debug_ops.context, level, fmt, ap); |