X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Flib-logging-internal.h;h=ae7fb9e6b31c171079e12414f76705e235269504;hb=63976d98f349c661f825bdcdd5a2f61d14280a03;hp=ca893d8ee2661eca16869242aba13aa0dac73610;hpb=a6918753fb268b5f69f80d2bb2d72fcc3de0f63b;p=babeltrace.git diff --git a/include/babeltrace/lib-logging-internal.h b/include/babeltrace/lib-logging-internal.h index ca893d8e..ae7fb9e6 100644 --- a/include/babeltrace/lib-logging-internal.h +++ b/include/babeltrace/lib-logging-internal.h @@ -2,7 +2,7 @@ #define BABELTRACE_LIB_LOGGING_INTERNAL_H /* - * Copyright 2017 Philippe Proulx + * Copyright 2017-2018 Philippe Proulx * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,6 +26,10 @@ #include #include +#ifndef BT_LOG_TAG +# error Please define a tag with BT_LOG_TAG before including this file. +#endif + #define BT_LOG_OUTPUT_LEVEL bt_lib_log_level #include @@ -58,7 +62,7 @@ int bt_lib_log_level; * `PRIi64`. * * The Babeltrace extension conversion specifier is accepted. Its syntax - * is: + * is either `%!u` to format a UUID (`bt_uuid` type) or: * * 1. Introductory `%!` sequence. * @@ -70,63 +74,62 @@ int bt_lib_log_level; * 3. Optional: `+` to print extended fields. This depends on the * provided format specifier. * - * 4. Objet category: `w` for CTF writer objects, `_` for common - * objects, or nothing for default objects (includes CTF IR). - * - * 5. Format specifier (see below). + * 4. Format specifier (see below). * * The available format specifiers are: * - * Default category: - * `r`: - * Reference count information. The parameter is any Babeltrace - * object. - * * `F`: - * CTF IR field type. The parameter type is `struct bt_field_type *`. + * Trace IR field class. The parameter type is + * `struct bt_field_class *`. * * `f`: - * CTF IR field. The parameter type is `struct bt_field *`. + * Trace IR field. The parameter type is `struct bt_field *`. * * `P`: * Field path. The parameter type is `struct bt_field_path *`. * * `E`: - * CTF IR event class. The parameter type is `struct bt_event_class *`. + * Trace IR event class. The parameter type is + * `struct bt_event_class *`. * * `e`: - * CTF IR event. The parameter type is `struct bt_event *`. + * Trace IR event. The parameter type is `struct bt_event *`. * * `S`: - * CTF IR stream class. The parameter type is `struct bt_stream_class *`. + * Trace IR stream class. The parameter type is + * `struct bt_stream_class *`. * * `s`: - * CTF IR stream. The parameter type is `struct bt_stream *`. + * Trace IR stream. The parameter type is `struct bt_stream *`. * * `a`: * Packet. The parameter type is `struct bt_packet *`. * + * `T`: + * Trace IR trace class. The parameter type is `struct bt_trace_class *`. + * * `t`: - * CTF IR trace. The parameter type is `struct bt_trace *`. + * Trace IR trace. The parameter type is `struct bt_trace *`. * * `K`: * Clock class. The parameter type is `struct bt_clock_class *`. * * `k`: - * Clock value. The parameter type is `struct bt_clock_value *`. + * Clock snapshot. The parameter type is `struct bt_clock_snapshot *`. * * `v`: * Value. The parameter type is `struct bt_value *`. * * `n`: - * Notification. The parameter type is `struct bt_notification *`. + * Message. The parameter type is `struct bt_message *`. * * `i`: - * Notification iterator. The parameter type is - * `struct bt_notification_iterator *`. + * Message iterator. The parameter type is + * `struct bt_message_iterator *`. * * `C`: - * Component class. The parameter type is `struct bt_component_class *`. + * Component class. The parameter type is + * `struct bt_component_class *`. * * `c`: * Component. The parameter type is `struct bt_component *`. @@ -140,76 +143,27 @@ int bt_lib_log_level; * `g`: * Graph. The parameter type is `struct bt_graph *`. * - * `u`: - * Plugin. The parameter type is `struct bt_plugin *`. + * `l`: + * Plugin. The parameter type is `const struct bt_plugin *`. * * `o`: * Object pool. The parameter type is `struct bt_object_pool *`. * - * CTF writer category: - * `F`: - * CTF writer field type. The parameter type is `struct bt_field_type *`. - * - * `f`: - * CTF writer field. The parameter type is `struct bt_field *`. - * - * `E`: - * CTF writer event class. The parameter type is - * `struct bt_event_class *`. - * - * `e`: - * CTF writer event. The parameter type is `struct bt_event *`. - * - * `S`: - * CTF writer stream class. The parameter type is - * `struct bt_stream_class *`. - * - * `s`: - * CTF writer stream. The parameter type is `struct bt_stream *`. - * - * `t`: - * CTF writer trace. The parameter type is `struct bt_trace *`. - * - * `w`: - * CTF writer. The parameter type is `struct bt_ctf_writer *`. - * - * Common category: - * `F`: - * Common field type. The parameter type is `struct bt_field_type *`. - * - * `f`: - * Common field. The parameter type is `struct bt_field *`. - * - * `E`: - * Common event class. The parameter type is - * `struct bt_event_class *`. - * - * `e`: - * Common event. The parameter type is `struct bt_event *`. - * - * `S`: - * Common stream class. The parameter type is - * `struct bt_stream_class *`. - * - * `s`: - * Common stream. The parameter type is `struct bt_stream *`. - * - * `t`: - * Common trace. The parameter type is `struct bt_trace *`. + * `O`: + * Object. The parameter type is `struct bt_object *`. * * Conversion specifier examples: * * %!f * %![my-event-]+e - * %!_t - * %![ctf-writer-ec-]wE - * %!+_F + * %!t + * %!+F * * The string `, ` is printed between individual fields, but not after * the last one. Therefore you must put this separator in the format - * string between two Babeltrace objects, e.g.: + * string between two conversion specifiers, e.g.: * - * BT_LIB_LOGW("Message: count=%u, %!E, %!+C", count, event_class, + * BT_LIB_LOGW("Message: count=%u, %!E, %!+K", count, event_class, * clock_class); * * Example with a custom prefix: @@ -232,7 +186,7 @@ int bt_lib_log_level; * Use one of the BT_LIB_LOGF*() macros above instead of calling this * function directly. */ -BT_HIDDEN + void bt_lib_log(const char *func, const char *file, unsigned line, int lvl, const char *tag, const char *fmt, ...);