diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2010-07-01 18:33:18 +1000 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2010-07-01 18:33:18 +1000 |
commit | 1bbd6e2b135adde22a03e3a067cd8bc86c86d41b (patch) | |
tree | 5de0228e6954491140019de4b2468b76c39a7a21 | |
parent | 70082cd669c4b6235a6b239e2f522b299d5e60e1 (diff) | |
download | samba-1bbd6e2b135adde22a03e3a067cd8bc86c86d41b.tar.gz samba-1bbd6e2b135adde22a03e3a067cd8bc86c86d41b.tar.xz samba-1bbd6e2b135adde22a03e3a067cd8bc86c86d41b.zip |
tdb: improve logging
When tdb throws an error, we didn't report the name of the tdb; we should.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(This used to be ctdb commit cfea357c9b2142c8cd8cac1ee712d40b188793e1)
-rw-r--r-- | ctdb/lib/util/db_wrap.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ctdb/lib/util/db_wrap.c b/ctdb/lib/util/db_wrap.c index 7f5240e932..9c4f6dd4d7 100644 --- a/ctdb/lib/util/db_wrap.c +++ b/ctdb/lib/util/db_wrap.c @@ -48,9 +48,10 @@ static void log_fn(struct tdb_context *tdb, enum tdb_debug_level level, const ch { if (level <= TDB_DEBUG_ERROR) { va_list ap; - + char newfmt[strlen(tdb_name(tdb)) + 1 + strlen(fmt) + 1]; + sprintf(newfmt, "%s:%s", tdb_name(tdb), fmt); va_start(ap, fmt); - do_debug_v(fmt, ap); + do_debug_v(newfmt, ap); va_end(ap); } } |