summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common/ldb_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/ldb/common/ldb_debug.c')
-rw-r--r--source4/lib/ldb/common/ldb_debug.c15
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 7680862c2c..4612b016f6 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);