src/common/uuid.h: wrap code in C++ guards
[babeltrace.git] / src / lib / lib-logging.c
index e4d3ac20c448fd470cb5dce4c33bc1074359fc9e..4085cd26f6a8885c80a513543f46cb2ba6a384c2 100644 (file)
@@ -21,8 +21,7 @@
 #include <babeltrace2/babeltrace.h>
 
 #include "logging.h"
-#include "assert-pre.h"
-#include "assert-post.h"
+#include "assert-cond.h"
 #include "value.h"
 #include "integer-range-set.h"
 #include "object-pool.h"
@@ -58,7 +57,6 @@
 #include "trace-ir/trace.h"
 #include "trace-ir/utils.h"
 #include "error.h"
-#include "assert-pre.h"
 
 #define LIB_LOGGING_BUF_SIZE   (4096 * 4)
 
@@ -1486,6 +1484,15 @@ update_fmt:
        *out_fmt_ch = fmt_ch;
 }
 
+void bt_lib_log_v(const char *func, const char *file, unsigned line,
+               int lvl, const char *tag, const char *fmt, va_list *args)
+{
+       BT_ASSERT(fmt);
+       bt_common_custom_vsnprintf(lib_logging_buf, LIB_LOGGING_BUF_SIZE, '!',
+               handle_conversion_specifier_bt, NULL, fmt, args);
+       _bt_log_write_d(func, file, line, lvl, tag, "%s", lib_logging_buf);
+}
+
 void bt_lib_log(const char *func, const char *file, unsigned line,
                int lvl, const char *tag, const char *fmt, ...)
 {
@@ -1493,10 +1500,8 @@ void bt_lib_log(const char *func, const char *file, unsigned line,
 
        BT_ASSERT(fmt);
        va_start(args, fmt);
-       bt_common_custom_vsnprintf(lib_logging_buf, LIB_LOGGING_BUF_SIZE, '!',
-               handle_conversion_specifier_bt, NULL, fmt, &args);
+       bt_lib_log_v(func, file, line, lvl, tag, fmt, &args);
        va_end(args);
-       _bt_log_write_d(func, file, line, lvl, tag, "%s", lib_logging_buf);
 }
 
 void bt_lib_maybe_log_and_append_cause(const char *func, const char *file,
This page took 0.025808 seconds and 4 git commands to generate.