lib: rename `lib-logging.h` to `logging.h`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 15 Jun 2019 17:02:55 +0000 (13:02 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 20 Jun 2019 18:01:16 +0000 (14:01 -0400)
Now we include "lib/logging.h" instead of "lib/lib-logging.h" to get
internal library logging support. The old file name was redundant.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I996b58c4b8c4914207a9f7e0b8ff6146ad65f5cb
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1473
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
49 files changed:
src/lib/Makefile.am
src/lib/assert-pre.h
src/lib/graph/component-class-sink-colander.c
src/lib/graph/component-class.c
src/lib/graph/component-filter.c
src/lib/graph/component-sink.c
src/lib/graph/component-source.c
src/lib/graph/component.c
src/lib/graph/connection.c
src/lib/graph/graph.c
src/lib/graph/iterator.c
src/lib/graph/message/discarded-items.c
src/lib/graph/message/event.c
src/lib/graph/message/message-iterator-inactivity.c
src/lib/graph/message/message.c
src/lib/graph/message/packet.c
src/lib/graph/message/stream-activity.c
src/lib/graph/message/stream.c
src/lib/graph/port.c
src/lib/graph/query-executor.c
src/lib/lib-logging.c
src/lib/lib-logging.h [deleted file]
src/lib/logging.c
src/lib/logging.h [new file with mode: 0644]
src/lib/object-pool.c
src/lib/plugin/plugin-so.c
src/lib/plugin/plugin.c
src/lib/plugin/plugin.h
src/lib/trace-ir/attributes.c
src/lib/trace-ir/clock-class.c
src/lib/trace-ir/clock-snapshot.c
src/lib/trace-ir/event-class.c
src/lib/trace-ir/event.c
src/lib/trace-ir/event.h
src/lib/trace-ir/field-class.c
src/lib/trace-ir/field-path.c
src/lib/trace-ir/field-wrapper.c
src/lib/trace-ir/field.c
src/lib/trace-ir/packet-context-field.c
src/lib/trace-ir/packet.c
src/lib/trace-ir/resolve-field-path.c
src/lib/trace-ir/stream-class.c
src/lib/trace-ir/stream.c
src/lib/trace-ir/trace-class.c
src/lib/trace-ir/trace.c
src/lib/trace-ir/utils.c
src/lib/util.c
src/lib/value.c
src/python-plugin-provider/python-plugin-provider.c

index 51da351b67449a92b221af1101fe2c3d499b5772..84e05257322e41aa32cc60db7cabb2562cdfeea3 100644 (file)
@@ -6,7 +6,7 @@ libbabeltrace2_la_SOURCES = \
        assert-pre.h \
        babeltrace2.c \
        lib-logging.c \
-       lib-logging.h \
+       logging.h \
        logging.c \
        object.h \
        object-pool.c \
index 9eeff141489006eedb44075f9d2944d01ba9f3d7..1f4240eb8e8205cf7af555b6f5fc72a24f4f09af 100644 (file)
  */
 
 /*
- * The macros in this header use macros defined in "lib/lib-logging.h".
+ * The macros in this header use macros defined in "lib/logging.h".
  * We don't want this header to automatically include
- * "lib/lib-logging.h" because you need to manually define BT_LOG_TAG
- * before including "lib/lib-logging.h" and it is unexpected that you
+ * "lib/logging.h" because you need to manually define BT_LOG_TAG
+ * before including "lib/logging.h" and it is unexpected that you
  * also need to define it before including this header.
  *
  * This is a reminder that in order to use "lib/assert-pre.h", you also
@@ -36,7 +36,7 @@
  */
 
 #ifndef BT_LIB_LOG_SUPPORTED
-# error Include "lib/lib-logging.h" before this header.
+# error Include "lib/logging.h" before this header.
 #endif
 
 #include <stdlib.h>
index c20ff5ec7a6450984b948232493a42320ecbd344..8a238f81f278318ca47ec825bdfadd45a103c47e 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #define BT_LOG_TAG "LIB/COLANDER"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "common/assert.h"
 #include "lib/assert-pre.h"
index 24a32ffc2df236e8fda444b1ab28d3788f14f93e..ad176f723693b0fd6a1fdc628afbd054237dc708 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/COMPONENT-CLASS"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "common/assert.h"
 #include "lib/assert-pre.h"
index 259ba6268bcc9573e635a21b802bdded45fcb037..a39e7e5ae5a19555bf78242b4afa40c37b19f565 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/COMPONENT-FILTER"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "common/assert.h"
 #include "lib/assert-pre.h"
index 6cb9187ceee61df6cea0be0002fd9dc4a7cd5090..fe25db6e5001a3eeca5142e64abdce94f342eaeb 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/COMPONENT-SINK"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "common/assert.h"
 #include "lib/assert-pre.h"
index 404da6917a7233b4123de42d861007aa8751a3b6..53d8b6d403105ae375cc026497d8aba232d0f734 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/COMPONENT-SOURCE"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "common/assert.h"
 #include "lib/assert-pre.h"
index b02d2a8cfcd293d364e2e6ae7706d2dc4f1bd5a9..7a6e8b021cf97c856061912d70028598120da3c1 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/COMPONENT"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "common/common.h"
 #include "common/assert.h"
index 8c31c38e0485114a28b03a0b438a95ec4028902a..98379daf5150556ab3adc085dab1679e28eb5c31 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/CONNECTION"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "common/assert.h"
 #include "lib/assert-pre.h"
index 70d958fc196bd1924dd449a2334b985ff52d273e..734ebb7ea1906c077356936efed93aefc2423f19 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/GRAPH"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "common/assert.h"
 #include "lib/assert-pre.h"
index 1303003f4963d7dbcc6f67963f89004590d2c0b8..a72611f6907622521ec3d95228c8ee39b756e930 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/MSG-ITER"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "compat/compiler.h"
 #include "lib/trace-ir/clock-class.h"
index 25836dc333cb85366764d012c0c490414a1da9f6..b38f8facc0e23e495a4e91033713ac5b48b023f2 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #define BT_LOG_TAG "LIB/MSG-DISCARDED-ITEMS"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include "lib/object.h"
index 8468186c24546ef3531d0e36faa98126dd576cb8..57f8c42999c74b2aeb5ee94f3529c082df24250e 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/MSG-EVENT"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "common/assert.h"
 #include "lib/assert-pre.h"
index 0c89d84cac6a7161fb0dfb6607a3c3b22851796b..f1b94dd0b5e204d40113f2e92ebe6e09bbff2c38 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #define BT_LOG_TAG "LIB/MSG-MSG-ITER-INACTIVITY"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include "lib/object.h"
index 25afe1a54e58611dc0fb80956485748873ed808a..d720a3bdbfc23549c8f8c58250ec981f07db3b3d 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/MSG"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "common/assert.h"
 #include "lib/assert-pre.h"
index 4a5a3e39b8dc42aa409bf662041e6136fcf685e7..88de665b79a656584cfb7d8b002f51ef3c3052c6 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/MSG-PACKET"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "compat/compiler.h"
 #include <babeltrace2/trace-ir/packet.h>
index dd8bd7e57b7dade1aefc928ec1cfd42970db907c..21275c1ffef6fd1a3fa8a5c33ea3913a56867f45 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #define BT_LOG_TAG "LIB/MSG-STREAM-ACTIVITY"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include "lib/object.h"
index ba8a91fa743d95d64b89e90df49989f313f3c72b..44c1a2d9241f3c5106d1499270ef06883d927d5c 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/MSG-STREAM"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include "compat/compiler.h"
index bf768ad0fbce3c0e07940b5da5b8572ce03ec420..df7c84df7285f26abe6cc87c90ec6e8f22eb3682 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/PORT"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "common/assert.h"
 #include "lib/assert-pre.h"
index 597804e6cab4bd918243017066763887fa6be814..6d5334453b9aff444a06ff2d5a1441041424648d 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #define BT_LOG_TAG "LIB/QUERY-EXECUTOR"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "common/assert.h"
 #include "common/common.h"
index 1433489b652d7692f5b790ceace8bdebc75e0c94..60ed8b6b82bafc2d6522537da4d6cd2dad470ddf 100644 (file)
@@ -59,7 +59,7 @@
 #include "graph/message/stream-activity.h"
 #include "graph/message/stream.h"
 #include "graph/port.h"
-#include "lib-logging.h"
+#include "logging.h"
 #include "plugin/plugin.h"
 #include "plugin/plugin-so.h"
 #include "trace-ir/clock-class.h"
diff --git a/src/lib/lib-logging.h b/src/lib/lib-logging.h
deleted file mode 100644 (file)
index 7bb36c9..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-#ifndef BABELTRACE_LIB_LOGGING_INTERNAL_H
-#define BABELTRACE_LIB_LOGGING_INTERNAL_H
-
-/*
- * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "common/macros.h"
-#include <stdarg.h>
-
-#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 "logging/log.h"
-
-extern
-int bt_lib_log_level;
-
-#define BT_LIB_LOG(_lvl, _fmt, ...)                                    \
-       do {                                                            \
-               if (BT_LOG_ON(_lvl)) {                                  \
-                       bt_lib_log(_BT_LOG_SRCLOC_FUNCTION, __FILE__,   \
-                               __LINE__, _lvl, _BT_LOG_TAG,            \
-                               (_fmt), ##__VA_ARGS__);                 \
-               }                                                       \
-       } while (0)
-
-/*
- * The six macros below are logging statements which are specialized
- * for the Babeltrace library.
- *
- * `_fmt` is a typical printf()-style format string, with the following
- * limitations:
- *
- * * The `*` width specifier is not accepted.
- * * The `*` precision specifier is not accepted.
- * * The `j` and `t` length modifiers are not accepted.
- * * The `n` format specifier is not accepted.
- * * The format specifiers defined in <inttypes.h> are not accepted
- *   except for `PRId64`, `PRIu64`, `PRIx64`, `PRIX64`, `PRIo64`, and
- *   `PRIi64`.
- *
- * The Babeltrace extension conversion specifier is accepted. Its syntax
- * is either `%!u` to format a UUID (`bt_uuid` type) or:
- *
- * 1. Introductory `%!` sequence.
- *
- * 2. Optional: `[` followed by a custom prefix for the printed fields
- *    of this specifier, followed by `]`. The standard form is to end
- *    this prefix with `-` so that, for example, with the prefix
- *    `prefix-`, the complete field name is `prefix-addr`.
- *
- * 3. Optional: `+` to print extended fields. This depends on the
- *    provided format specifier.
- *
- * 4. Format specifier (see below).
- *
- * The available format specifiers are:
- *
- *   `F`:
- *       Trace IR field class. The parameter type is
- *      `struct bt_field_class *`.
- *
- *   `f`:
- *       Trace IR field. The parameter type is `struct bt_field *`.
- *
- *   `P`:
- *       Field path. The parameter type is `struct bt_field_path *`.
- *
- *   `E`:
- *       Trace IR event class. The parameter type is
- *      `struct bt_event_class *`.
- *
- *   `e`:
- *       Trace IR event. The parameter type is `struct bt_event *`.
- *
- *   `S`:
- *       Trace IR stream class. The parameter type is
- *      `struct bt_stream_class *`.
- *
- *   `s`:
- *       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`:
- *       Trace IR trace. The parameter type is `struct bt_trace *`.
- *
- *   `K`:
- *       Clock class. The parameter type is `struct bt_clock_class *`.
- *
- *   `k`:
- *       Clock snapshot. The parameter type is `struct bt_clock_snapshot *`.
- *
- *   `v`:
- *       Value. The parameter type is `struct bt_value *`.
- *
- *   `n`:
- *       Message. The parameter type is `struct bt_message *`.
- *
- *   `i`:
- *       Message iterator. The parameter type is
- *       `struct bt_message_iterator *`.
- *
- *   `C`:
- *       Component class. The parameter type is
- *      `struct bt_component_class *`.
- *
- *   `c`:
- *       Component. The parameter type is `struct bt_component *`.
- *
- *   `p`:
- *       Port. The parameter type is `struct bt_port *`.
- *
- *   `x`:
- *       Connection. The parameter type is `struct bt_connection *`.
- *
- *   `g`:
- *       Graph. The parameter type is `struct bt_graph *`.
- *
- *   `l`:
- *       Plugin. The parameter type is `const struct bt_plugin *`.
- *
- *   `o`:
- *       Object pool. The parameter type is `struct bt_object_pool *`.
- *
- *   `O`:
- *       Object. The parameter type is `struct bt_object *`.
- *
- * Conversion specifier examples:
- *
- *     %!f
- *     %![my-event-]+e
- *     %!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 conversion specifiers, e.g.:
- *
- *     BT_LIB_LOGW("Message: count=%u, %!E, %!+K", count, event_class,
- *                 clock_class);
- *
- * Example with a custom prefix:
- *
- *     BT_LIB_LOGI("Some message: %![ec-a-]e, %![ec-b-]+e", ec_a, ec_b);
- *
- * It is safe to pass NULL as any Babeltrace object parameter: the
- * macros only print its null address.
- */
-#define BT_LIB_LOGF(_fmt, ...) BT_LIB_LOG(BT_LOG_FATAL, _fmt, ##__VA_ARGS__)
-#define BT_LIB_LOGE(_fmt, ...) BT_LIB_LOG(BT_LOG_ERROR, _fmt, ##__VA_ARGS__)
-#define BT_LIB_LOGW(_fmt, ...) BT_LIB_LOG(BT_LOG_WARN, _fmt, ##__VA_ARGS__)
-#define BT_LIB_LOGI(_fmt, ...) BT_LIB_LOG(BT_LOG_INFO, _fmt, ##__VA_ARGS__)
-#define BT_LIB_LOGD(_fmt, ...) BT_LIB_LOG(BT_LOG_DEBUG, _fmt, ##__VA_ARGS__)
-#define BT_LIB_LOGV(_fmt, ...) BT_LIB_LOG(BT_LOG_VERBOSE, _fmt, ##__VA_ARGS__)
-
-/*
- * Log statement, specialized for the Babeltrace library.
- *
- * Use one of the BT_LIB_LOGF*() macros above instead of calling this
- * function directly.
- */
-
-void bt_lib_log(const char *func, const char *file, unsigned line,
-               int lvl, const char *tag, const char *fmt, ...);
-
-#define BT_LIB_LOG_SUPPORTED
-
-#endif /* BABELTRACE_LIB_LOGGING_INTERNAL_H */
index b362d667f63e6ea5df925af8ea884cbb9291a711..8c36f5abd728cc25f4aacd52197ee49b031a1b29 100644 (file)
@@ -25,7 +25,7 @@
 #include <babeltrace2/version.h>
 
 #define BT_LOG_TAG "LIB/LOGGING"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #ifdef BT_DEV_MODE
 /*
diff --git a/src/lib/logging.h b/src/lib/logging.h
new file mode 100644 (file)
index 0000000..7bb36c9
--- /dev/null
@@ -0,0 +1,195 @@
+#ifndef BABELTRACE_LIB_LOGGING_INTERNAL_H
+#define BABELTRACE_LIB_LOGGING_INTERNAL_H
+
+/*
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "common/macros.h"
+#include <stdarg.h>
+
+#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 "logging/log.h"
+
+extern
+int bt_lib_log_level;
+
+#define BT_LIB_LOG(_lvl, _fmt, ...)                                    \
+       do {                                                            \
+               if (BT_LOG_ON(_lvl)) {                                  \
+                       bt_lib_log(_BT_LOG_SRCLOC_FUNCTION, __FILE__,   \
+                               __LINE__, _lvl, _BT_LOG_TAG,            \
+                               (_fmt), ##__VA_ARGS__);                 \
+               }                                                       \
+       } while (0)
+
+/*
+ * The six macros below are logging statements which are specialized
+ * for the Babeltrace library.
+ *
+ * `_fmt` is a typical printf()-style format string, with the following
+ * limitations:
+ *
+ * * The `*` width specifier is not accepted.
+ * * The `*` precision specifier is not accepted.
+ * * The `j` and `t` length modifiers are not accepted.
+ * * The `n` format specifier is not accepted.
+ * * The format specifiers defined in <inttypes.h> are not accepted
+ *   except for `PRId64`, `PRIu64`, `PRIx64`, `PRIX64`, `PRIo64`, and
+ *   `PRIi64`.
+ *
+ * The Babeltrace extension conversion specifier is accepted. Its syntax
+ * is either `%!u` to format a UUID (`bt_uuid` type) or:
+ *
+ * 1. Introductory `%!` sequence.
+ *
+ * 2. Optional: `[` followed by a custom prefix for the printed fields
+ *    of this specifier, followed by `]`. The standard form is to end
+ *    this prefix with `-` so that, for example, with the prefix
+ *    `prefix-`, the complete field name is `prefix-addr`.
+ *
+ * 3. Optional: `+` to print extended fields. This depends on the
+ *    provided format specifier.
+ *
+ * 4. Format specifier (see below).
+ *
+ * The available format specifiers are:
+ *
+ *   `F`:
+ *       Trace IR field class. The parameter type is
+ *      `struct bt_field_class *`.
+ *
+ *   `f`:
+ *       Trace IR field. The parameter type is `struct bt_field *`.
+ *
+ *   `P`:
+ *       Field path. The parameter type is `struct bt_field_path *`.
+ *
+ *   `E`:
+ *       Trace IR event class. The parameter type is
+ *      `struct bt_event_class *`.
+ *
+ *   `e`:
+ *       Trace IR event. The parameter type is `struct bt_event *`.
+ *
+ *   `S`:
+ *       Trace IR stream class. The parameter type is
+ *      `struct bt_stream_class *`.
+ *
+ *   `s`:
+ *       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`:
+ *       Trace IR trace. The parameter type is `struct bt_trace *`.
+ *
+ *   `K`:
+ *       Clock class. The parameter type is `struct bt_clock_class *`.
+ *
+ *   `k`:
+ *       Clock snapshot. The parameter type is `struct bt_clock_snapshot *`.
+ *
+ *   `v`:
+ *       Value. The parameter type is `struct bt_value *`.
+ *
+ *   `n`:
+ *       Message. The parameter type is `struct bt_message *`.
+ *
+ *   `i`:
+ *       Message iterator. The parameter type is
+ *       `struct bt_message_iterator *`.
+ *
+ *   `C`:
+ *       Component class. The parameter type is
+ *      `struct bt_component_class *`.
+ *
+ *   `c`:
+ *       Component. The parameter type is `struct bt_component *`.
+ *
+ *   `p`:
+ *       Port. The parameter type is `struct bt_port *`.
+ *
+ *   `x`:
+ *       Connection. The parameter type is `struct bt_connection *`.
+ *
+ *   `g`:
+ *       Graph. The parameter type is `struct bt_graph *`.
+ *
+ *   `l`:
+ *       Plugin. The parameter type is `const struct bt_plugin *`.
+ *
+ *   `o`:
+ *       Object pool. The parameter type is `struct bt_object_pool *`.
+ *
+ *   `O`:
+ *       Object. The parameter type is `struct bt_object *`.
+ *
+ * Conversion specifier examples:
+ *
+ *     %!f
+ *     %![my-event-]+e
+ *     %!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 conversion specifiers, e.g.:
+ *
+ *     BT_LIB_LOGW("Message: count=%u, %!E, %!+K", count, event_class,
+ *                 clock_class);
+ *
+ * Example with a custom prefix:
+ *
+ *     BT_LIB_LOGI("Some message: %![ec-a-]e, %![ec-b-]+e", ec_a, ec_b);
+ *
+ * It is safe to pass NULL as any Babeltrace object parameter: the
+ * macros only print its null address.
+ */
+#define BT_LIB_LOGF(_fmt, ...) BT_LIB_LOG(BT_LOG_FATAL, _fmt, ##__VA_ARGS__)
+#define BT_LIB_LOGE(_fmt, ...) BT_LIB_LOG(BT_LOG_ERROR, _fmt, ##__VA_ARGS__)
+#define BT_LIB_LOGW(_fmt, ...) BT_LIB_LOG(BT_LOG_WARN, _fmt, ##__VA_ARGS__)
+#define BT_LIB_LOGI(_fmt, ...) BT_LIB_LOG(BT_LOG_INFO, _fmt, ##__VA_ARGS__)
+#define BT_LIB_LOGD(_fmt, ...) BT_LIB_LOG(BT_LOG_DEBUG, _fmt, ##__VA_ARGS__)
+#define BT_LIB_LOGV(_fmt, ...) BT_LIB_LOG(BT_LOG_VERBOSE, _fmt, ##__VA_ARGS__)
+
+/*
+ * Log statement, specialized for the Babeltrace library.
+ *
+ * Use one of the BT_LIB_LOGF*() macros above instead of calling this
+ * function directly.
+ */
+
+void bt_lib_log(const char *func, const char *file, unsigned line,
+               int lvl, const char *tag, const char *fmt, ...);
+
+#define BT_LIB_LOG_SUPPORTED
+
+#endif /* BABELTRACE_LIB_LOGGING_INTERNAL_H */
index 3aa9b2e1e64412d14d37b94ee4aa13ab79f80303..dda8b718f4827a4409190acf5a2626d8c23468a6 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #define BT_LOG_TAG "LIB/OBJECT-POOL"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include <stdint.h>
 #include "common/assert.h"
index fac050dcbbd9dbbafb55ca17494a966b32aa31e3..13cf322084e2e0376b9bc76eff76be4c2373c0fd 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 #define BT_LOG_TAG "LIB/PLUGIN-SO"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "common/assert.h"
 #include "lib/assert-pre.h"
index 9459438662b9e5ad9a1bd9042c2b42dc4cc79a2a..c0cd158abaecd5010cb7741fe24f369ab326b672 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 #define BT_LOG_TAG "LIB/PLUGIN"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "common/assert.h"
 #include "lib/assert-pre.h"
index edaad960f0a4738e746e07ac4ee604570268980b..ed2fc4a75cd4702fe2398249063f6a1b9c339c86 100644 (file)
@@ -37,7 +37,7 @@
 
 /* Protection: this file uses BT_LIB_LOG*() macros directly */
 #ifndef BT_LIB_LOG_SUPPORTED
-# error Please include "lib/lib-logging.h" before including this file.
+# error Please include "lib/logging.h" before including this file.
 #endif
 
 enum bt_plugin_type {
index c68531c692fe0de425d31e98748fe3c705e3f50d..43f71437817825a50869eb14ccc457e39fc17fa4 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/ATTRS"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "common/macros.h"
 #include <babeltrace2/value.h>
index dd78c8c938bb184649b85f4236430394bcb173af..e84a41b537d122d8fdad70a998995e13f9117852 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/CLOCK-CLASS"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include "compat/uuid.h"
index 6b44334e914c1d289ce87a0a1bdb8afd23df37dc..944532a2359e8acce1d40593a2ca05f7760ecc7c 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #define BT_LOG_TAG "LIB/CLOCK-SNAPSHOT"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include "compat/uuid.h"
index 3f4f5d2db0ab5357b52361aa09226eb9c454f490..63a250bbef3ce7ad6808f1776022bddc1c4a5d13 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/EVENT-CLASS"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include <babeltrace2/trace-ir/field-class.h>
index 7f93d065eb0e1f8ea8e1ddaf2b203a766588a6db..0053b6b7f9dc8ab7c1c531342f973832a7733d58 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/EVENT"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include <babeltrace2/trace-ir/event-const.h>
index 9cfbb56ab87227293ce8f9404a29f2efdab48d28..b2f085a0ea3106cb2b7c378c7091edbb06ab6341 100644 (file)
@@ -26,7 +26,7 @@
 
 /* Protection: this file uses BT_LIB_LOG*() macros directly */
 #ifndef BT_LIB_LOG_SUPPORTED
-# error Please include "lib/lib-logging.h" before including this file.
+# error Please include "lib/logging.h" before including this file.
 #endif
 
 #include "lib/assert-pre.h"
index b6a1f65de0773190a3df2efc4f741ebfa6a035d1..3f658a5193055c94f4b9c49bbbddf00852225f9b 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/FIELD-CLASS"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include <babeltrace2/trace-ir/field-class.h>
index 32d805524fa3ee46e73a62a64890e9fe6eea4b7a..9a4af3a29a8ab090be9a1c99cd9fde34ee185b9b 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/FIELD-PATH"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include <babeltrace2/trace-ir/field-class.h>
index 86949fe131845a65f9d74885b105c4a76357ecb3..f1dcb6799895fad082dba920cd4e61d485317380 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #define BT_LOG_TAG "LIB/FIELD-WRAPPER"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/object-pool.h"
 #include "lib/object.h"
index ff5c65a683656dfd856c16261a715a7cc90e204f..7dc4d90d92a045efcafa7ec4a61a39ddaa6cf3ca 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/FIELD"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include <babeltrace2/trace-ir/field.h>
index 612adb94677ad02075e819ea1beb2a35382e2935..1530ef97873028a585706139c82291fce08e3988 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #define BT_LOG_TAG "LIB/PACKET-CONTEXT-FIELD"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include <babeltrace2/trace-ir/packet-context-field.h>
index 6aeb2b89ecb2255c678aba8e79679e6233784e37..a9c4ea9e453e8920098326e7f2329497475fd1c1 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #define BT_LOG_TAG "LIB/PACKET"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include <babeltrace2/trace-ir/packet-const.h>
index febcfdee5383aa3997c3490c091e5a2a4dc1853a..ed44e059e7dcba5c5284d79557770e22bcafbc1b 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #define BT_LOG_TAG "LIB/RESOLVE-FIELD-PATH"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include "common/assert.h"
index be5752965d98f4501c4b5e3bd0ede7ec88eeee53..b1a528ef04e3e398b20a303ab00cb653e7e19d16 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/STREAM-CLASS"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include <babeltrace2/trace-ir/trace-const.h>
index a19828f46ac6465b1f84839d350103932c02c70f..7eb8e9cfa9731b8cecde04ae6d174f4a6e043e35 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/STREAM"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include <babeltrace2/trace-ir/stream-const.h>
index 28e124803a9d390fe48ec9aae2f3b7440ea74b52..bd8ff19f2eb3ac030d1ee08c80a2bc27c1bc9271 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/TRACE"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include <babeltrace2/trace-ir/trace-class.h>
index 9c5b9acf664969625cc0fe91127ff49c17b73647..3c0308386c4be8ab0ab6e475334fa1a7884215ef 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/TRACE"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include <babeltrace2/trace-ir/trace.h>
index 1ba0678531e5e95826e2d76232354768caf99e3a..06959f588bbbd4bbd519354289d544d2d548d4dd 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #define BT_LOG_TAG "LIB/TRACE-IR-UTILS"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include <stdlib.h>
 #include <glib.h>
index 250ce8a413aa07c1485d80a9642fab39cdc62482..3e3eb45e13f1a2341690f444fd34f44d63aa41c6 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #define BT_LOG_TAG "LIB/UTIL"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
 #include <stdlib.h>
index 38ff22014a986a96e4943d543def6691ff8ad7d0..a288dc54fd9b2d0ce544a9ed870ee2ee34c95ba0 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #define BT_LOG_TAG "LIB/VALUE"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include <stdlib.h>
 #include <string.h>
index 88c04e84a065f7a09629bc11605ae3e72390b1c0..6f775cb00ee3948b18f2e54e52a49ef4732ac020 100644 (file)
@@ -26,7 +26,7 @@
 
 #define BT_LOG_TAG "LIB/PLUGIN-PY"
 
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 #include "common/macros.h"
 #include "compat/compiler.h"
 #include <babeltrace2/plugin/plugin-const.h>
This page took 0.045463 seconds and 4 git commands to generate.