As there's no noticeable performance difference between having the INFO
log level and the FATAL log level as the build's minimal log level,
force it to be TRACE, DEBUG, or INFO. This means that INFO, WARN, ERROR,
and FATAL logging is always enabled, whatever the build configuration.
This seems reasonable and could prove useful to support/debugging
operations.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ie4261fd16d344587ef4b37ea1715d7302ad25087
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1590
+
The default build-time log level is `DEBUG`. For optimal performance,
set it to `INFO`, which effectively disables all fast path logging in
+
The default build-time log level is `DEBUG`. For optimal performance,
set it to `INFO`, which effectively disables all fast path logging in
-all the Babeltrace modules.
+all the Babeltrace modules. You can't set it to `WARN`, `ERROR`,
+`FATAL`, or `NONE` because the impact on performance is minuscule
+starting from the _INFO_ log level anyway and we want any Babeltrace
+build to always be able to print _INFO_-level logs.
+
The library's public API provides `bt_logging_get_minimal_level()` to
get the configured minimal log level.
+
The library's public API provides `bt_logging_get_minimal_level()` to
get the configured minimal log level.
* Failed assertion (within `BT_ASSERT()`).
* Unsatisfied library precondition (within `BT_ASSERT_PRE()`).
* Unsatisfied library postcondition (within `BT_ASSERT_POST()`).
* Failed assertion (within `BT_ASSERT()`).
* Unsatisfied library precondition (within `BT_ASSERT_PRE()`).
* Unsatisfied library postcondition (within `BT_ASSERT_POST()`).
-|Almost none: should be executed in production.
+|Almost none: always enabled.
failure to create an empty object (no parameters): most probably
failed internally because of an allocation error.
* Almost any error in terminal elements: CLI and plugins.
failure to create an empty object (no parameters): most probably
failed internally because of an allocation error.
* Almost any error in terminal elements: CLI and plugins.
-|Almost none: should be executed in production.
+|Almost none: always enabled.
* Missing data within something that is expected to have it, but there's
an alternative.
* Invalid file, but recoverable/fixable.
* Missing data within something that is expected to have it, but there's
an alternative.
* Invalid file, but recoverable/fixable.
-|Almost none: can be executed in production.
+|Almost none: always enabled.
* An _optional_ subsystem cannot be loaded.
* An _optional_ field/datum cannot be found.
|
* An _optional_ subsystem cannot be loaded.
* An _optional_ field/datum cannot be found.
|
-Very little: can be executed in production if _INFO_ level information
-is desired.
+Very little: always enabled.
AS_IF([test "x$PLUGINSDIR" = x], [PLUGINSDIR='$(libdir)/babeltrace2/plugins'])
# BABELTRACE_MINIMAL_LOG_LEVEL:
AS_IF([test "x$PLUGINSDIR" = x], [PLUGINSDIR='$(libdir)/babeltrace2/plugins'])
# BABELTRACE_MINIMAL_LOG_LEVEL:
-AC_ARG_VAR([BABELTRACE_MINIMAL_LOG_LEVEL], [Minimal log level for Babeltrace program, library, and plugins (TRACE, DEBUG (default), INFO, WARN, ERROR, FATAL, or NONE)])
+AC_ARG_VAR([BABELTRACE_MINIMAL_LOG_LEVEL], [Minimal log level for Babeltrace program, library, and plugins (TRACE, DEBUG (default), or INFO)])
AS_IF([test "x$BABELTRACE_MINIMAL_LOG_LEVEL" = x], [BABELTRACE_MINIMAL_LOG_LEVEL="DEBUG"])
AS_IF([test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "TRACE" && \
test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "DEBUG" && \
AS_IF([test "x$BABELTRACE_MINIMAL_LOG_LEVEL" = x], [BABELTRACE_MINIMAL_LOG_LEVEL="DEBUG"])
AS_IF([test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "TRACE" && \
test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "DEBUG" && \
- test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "INFO" && \
- test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "WARN" && \
- test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "ERROR" && \
- test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "FATAL" && \
- test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "NONE"],
- [AC_MSG_ERROR([Invalid BABELTRACE_MINIMAL_LOG_LEVEL value ($BABELTRACE_MINIMAL_LOG_LEVEL): use TRACE, DEBUG, INFO, WARN, ERROR, FATAL, or NONE.])]
+ test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "INFO"],
+ [AC_MSG_ERROR([Invalid BABELTRACE_MINIMAL_LOG_LEVEL value ($BABELTRACE_MINIMAL_LOG_LEVEL): use TRACE, DEBUG, or INFO.])]
)
AC_DEFINE_UNQUOTED([BT_MINIMAL_LOG_LEVEL], [BT_LOG_$BABELTRACE_MINIMAL_LOG_LEVEL], [Minimal log level])
)
AC_DEFINE_UNQUOTED([BT_MINIMAL_LOG_LEVEL], [BT_LOG_$BABELTRACE_MINIMAL_LOG_LEVEL], [Minimal log level])