lib/object.h: log conditionally to `BT_OBJECT_DONT_LOG` undefined
There are a few places within the project, but outside the library, that
for historic reasons use the library's internal `bt_object` API to have
reference counting. The `bt_object` API belongs to the library for the
moment and should not be included as such.
There's an issue when you need logging in your module and the functions
which log within `object.h` cannot make sense of the
`BT_LOG_OUTPUT_LEVEL` expression. To avoid this and save short-term
development time, make them not log if `BT_OBJECT_DONT_LOG` is defined.
Then, outside the library, you can do something like:
#define BT_LOG_OUTPUT_LEVEL my_log_level
#define BT_LOG_TAG MY-TAG
#include "logging/log.h"
#define BT_OBJECT_DONT_LOG
#include "lib/object.h"
Another solution would be to include `lib/logging.h` before
`logging/log.h`, but that's not always easy.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: If3037b67e5c4f87f57db96528d0a9516c8f9d6ea
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1493
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
This page took 0.025367 seconds and 4 git commands to generate.