projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib: introduce bt_message_iterator_class
[babeltrace.git]
/
src
/
lib
/
lib-logging.c
diff --git
a/src/lib/lib-logging.c
b/src/lib/lib-logging.c
index ee11fad0ce5b0b682a0837f2acaf8dadf3b0c306..02f18ed5a9d94e500f522dbe22492af10160f72f 100644
(file)
--- a/
src/lib/lib-logging.c
+++ b/
src/lib/lib-logging.c
@@
-28,6
+28,7
@@
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
+#include <stdbool.h>
#include <stdint.h>
#include <wchar.h>
#include <glib.h>
#include <stdint.h>
#include <wchar.h>
#include <glib.h>
@@
-110,7
+111,7
@@
static __thread char lib_logging_buf[LIB_LOGGING_BUF_SIZE];
prefix, (_prefix2)); \
\
if (snprintf_ret < 0 || snprintf_ret >= TMP_PREFIX_LEN - 1) { \
prefix, (_prefix2)); \
\
if (snprintf_ret < 0 || snprintf_ret >= TMP_PREFIX_LEN - 1) { \
-
abort();
\
+
bt_common_abort();
\
} \
\
tmp_prefix[TMP_PREFIX_LEN - 1] = '\0'; \
} \
\
tmp_prefix[TMP_PREFIX_LEN - 1] = '\0'; \
@@
-489,7
+490,7
@@
static inline void format_field_path(char **buf_ch, bool extended,
BUF_APPEND("%s", ", <CUR>");
break;
default:
BUF_APPEND("%s", ", <CUR>");
break;
default:
- abort();
+
bt_common_
abort();
}
}
}
}
@@
-1197,6
+1198,13
@@
static inline void format_graph(char **buf_ch, bool extended,
&graph->packet_end_msg_pool);
}
&graph->packet_end_msg_pool);
}
+static inline void format_message_iterator_class(char **buf_ch,
+ bool extended, const char *prefix,
+ const struct bt_message_iterator_class *iterator_class)
+{
+ /* Empty, the address is automatically printed. */
+}
+
static inline void format_message_iterator(char **buf_ch,
bool extended, const char *prefix,
const struct bt_message_iterator *iterator)
static inline void format_message_iterator(char **buf_ch,
bool extended, const char *prefix,
const struct bt_message_iterator *iterator)
@@
-1446,6
+1454,9
@@
static inline void handle_conversion_specifier_bt(void *priv_data,
case 'n':
format_message(buf_ch, extended, prefix, obj);
break;
case 'n':
format_message(buf_ch, extended, prefix, obj);
break;
+ case 'I':
+ format_message_iterator_class(buf_ch, extended, prefix, obj);
+ break;
case 'i':
format_message_iterator(buf_ch, extended, prefix, obj);
break;
case 'i':
format_message_iterator(buf_ch, extended, prefix, obj);
break;
@@
-1480,7
+1491,7
@@
static inline void handle_conversion_specifier_bt(void *priv_data,
format_error_cause(buf_ch, extended, prefix, obj);
break;
default:
format_error_cause(buf_ch, extended, prefix, obj);
break;
default:
- abort();
+
bt_common_
abort();
}
update_fmt:
}
update_fmt:
@@
-1521,7
+1532,8
@@
void bt_lib_maybe_log_and_append_cause(const char *func, const char *file,
}
status = bt_current_thread_error_append_cause_from_unknown(
}
status = bt_current_thread_error_append_cause_from_unknown(
- "Babeltrace library", file, line, "%s", lib_logging_buf);
+ BT_LIB_LOG_LIBBABELTRACE2_NAME, file, line, "%s",
+ lib_logging_buf);
if (status) {
/*
* Worst case: this error cause is not appended to the
if (status) {
/*
* Worst case: this error cause is not appended to the
This page took
0.043275 seconds
and
4
git commands to generate.