]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/test/logging.c
tdb2: enforce TDB_CONVERT
[ccan] / ccan / tdb2 / test / logging.c
index e36e2b8818d5ce41ffe9a9e458a0d5b60f6e17d1..4857a4bfad7896e50272e52ab3ff0ab84e0d12a7 100644 (file)
@@ -5,6 +5,7 @@
 
 unsigned tap_log_messages;
 const char *log_prefix = "";
+char *log_last = NULL;
 bool suppress_logging;
 
 union tdb_attribute tap_log_attr = {
@@ -20,6 +21,9 @@ void tap_log_fn(struct tdb_context *tdb,
                return;
 
        diag("tdb log level %u: %s%s", level, log_prefix, message);
+       if (log_last)
+               free(log_last);
+       log_last = strdup(message);
        tap_log_messages++;
 }