Do not require logging support for BT_[CTF_]ASSERT_PRE()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 26 Jun 2019 18:39:42 +0000 (14:39 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 27 Jun 2019 01:39:06 +0000 (21:39 -0400)
commit34ae0d6283e68bfecdcc80f56ff174bb2f49c7fa
treeaeedef335bda48acd3d8e1f1f3157af46894f085
parent9736d991ea189f29b908e9cf18103c1452c59e05
Do not require logging support for BT_[CTF_]ASSERT_PRE()

This patch makes the BT_ASSERT_PRE(), BT_ASSERT_PRE_MSG(),
BT_CTF_ASSERT_PRE(), and BT_CTF_ASSERT_PRE_MSG() not use BT_LIB_LOGF()
and BT_LOGF() directly to not rely on the active log level to print the
messages.

This makes it possible to configure the build with
`BABELTRACE_DEV_MODE=1` and `BABELTRACE_MINIMAL_LOG_LEVEL=NONE` and
still get the precondition failure messages. This removes some code
in `configure.ac` and `src/lib/logging.c` which ensured that the log
level could not be NONE when developer mode is enabled.

The macros now use _bt_log_write_d() (which does not check the active
log level) and bt_lib_log() (which uses _bt_log_write_d() without
checking the active log level) instead of BT_LOGF() and BT_LIB_LOGF().

The `assert-pre.h` header still require that you include
`"lib/logging.h"` or `"logging/log.h"` before because this is where the
logging tag and logging functions are found.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: If98a1c074d211cf257742d55960b379bbe9c6cf0
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1546
Tested-by: jenkins <jenkins@lttng.org>
configure.ac
src/ctf-writer/assert-pre.h
src/lib/assert-pre.h
src/lib/logging.c
This page took 0.025273 seconds and 4 git commands to generate.