example libctdb.a and test program libctdb/tst.c
[sahlberg/ctdb.git] / include / includes.h
index 43a6a5ff68746a6c0fe8a488ec0780e78add469e..7e1566c3bf433a6e46d6bc81f2c37c99ff8e3ff9 100644 (file)
@@ -27,8 +27,11 @@ enum debug_level {
        DEBUG_DEBUG   =  4,
 };
 
+typedef void ctdb_ringbuf_log_fn(const char *format, ...);
+extern ctdb_ringbuf_log_fn *ctdb_ringbuf_log;
+
 #define DEBUGLVL(lvl) ((lvl) <= LogLevel)
-#define DEBUG(lvl, x) do { this_log_level = (lvl); if ((lvl) < DEBUG_DEBUG) { log_ringbuffer x; } if ((lvl) <= LogLevel) { do_debug x; }} while (0)
+#define DEBUG(lvl, x) do { this_log_level = (lvl); if (ctdb_ringbuf_log && (lvl) < DEBUG_DEBUG) { ctdb_ringbuf_log x; } if ((lvl) <= LogLevel) { do_debug x; }} while (0)
 #define DEBUGADD(lvl, x) do { if ((lvl) <= LogLevel) { this_log_level = (lvl); do_debug_add x; }} while (0)
 
 #define _PUBLIC_