]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/test/logging.c
tdb2: Hand error code to logging function.
[ccan] / ccan / tdb2 / test / logging.c
index 4857a4bfad7896e50272e52ab3ff0ab84e0d12a7..0712cc00a621db816c5e4377958bf10db841486b 100644 (file)
@@ -15,12 +15,14 @@ union tdb_attribute tap_log_attr = {
 
 void tap_log_fn(struct tdb_context *tdb,
                enum tdb_log_level level,
+               enum TDB_ERROR ecode,
                const char *message, void *priv)
 {
        if (suppress_logging)
                return;
 
-       diag("tdb log level %u: %s%s", level, log_prefix, message);
+       diag("tdb log level %u: %s: %s%s",
+            level, tdb_errorstr(ecode), log_prefix, message);
        if (log_last)
                free(log_last);
        log_last = strdup(message);