X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Flib%2Flib-logging.c;h=df73244b22e969978054b679d7330c97357d1f6e;hb=867eb7632255f6a84234542198bd7edaac1bce12;hp=1730f6d09c93588f43f2388da579b0b820daa2e6;hpb=d98421f2abfc5adab28ab7ee9b63537a6c7261cc;p=babeltrace.git diff --git a/src/lib/lib-logging.c b/src/lib/lib-logging.c index 1730f6d0..df73244b 100644 --- a/src/lib/lib-logging.c +++ b/src/lib/lib-logging.c @@ -932,7 +932,7 @@ static inline void format_message(char **buf_ch, bool extended, char tmp_prefix[TMP_PREFIX_LEN]; BUF_APPEND(", %stype=%s", - PRFIELD(bt_message_type_string(msg->type))); + PRFIELD(bt_common_message_type_string(msg->type))); if (!extended) { return; @@ -1057,7 +1057,7 @@ static inline void format_component_class(char **buf_ch, bool extended, char tmp_prefix[TMP_PREFIX_LEN]; BUF_APPEND(", %stype=%s, %sname=\"%s\"", - PRFIELD(bt_component_class_type_string(comp_class->type)), + PRFIELD(bt_common_component_class_type_string(comp_class->type)), PRFIELD_GSTRING(comp_class->name)); if (comp_class->description) { @@ -1335,7 +1335,7 @@ static inline void format_error_cause(char **buf_ch, bool extended, if (comp_class_id) { BUF_APPEND(", %scomp-cls-type=%s, %scomp-cls-name=\"%s\", " "%splugin-name=\"%s\"", - PRFIELD(bt_component_class_type_string( + PRFIELD(bt_common_component_class_type_string( comp_class_id->type)), PRFIELD_GSTRING(comp_class_id->name), PRFIELD_GSTRING(comp_class_id->plugin_name)); @@ -1484,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, ...) { @@ -1491,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,