cli: add component-specific `--log-level` option (run/convert commands)
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 15 Jun 2019 02:52:27 +0000 (22:52 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 20 Jun 2019 18:51:58 +0000 (14:51 -0400)
commitc4f81dc99085fd4502d3b6ae911ea46c26d7cf5e
tree9065a0d0a191428b48bcfcef7822197f6c0edf42
parent8d81b92fdb5fd4a8a591b978689837c2e650a87f
cli: add component-specific `--log-level` option (run/convert commands)

This new option makes it possible to specify a log level for a specific
component instance. The main program's `--log-level` option becomes the
default log level which the specific `--log-level` options override.

For example:

    babeltrace2 -c src.mein.source --log-level=I \
                -c sink.ctf.fs --log-level=D

makes the log level of the source be INFO and the log level of the
sink be DEBUG. The log level of the other components (implicit muxer),
of the CLI, and of the library is the default WARN.

    babeltrace2 --log-level=E -c src.mein.source --log-level=I \
                              -c sink.ctf.fs

makes the log level of the source be INFO and the log level of the sink,
of the other components (implicit muxer), of the CLI, and of the library
be ERROR.

The CLI still sets the known log level environment variables until
subsequent patches make each component honor its initial log level, that
is, until each component uses the log level for its logging statements
as returned by bt_component_get_logging_level().

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I8a3b05b7147fdb0149ecff670c542c9a229beddb
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1458
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
src/cli/babeltrace2-cfg-cli-args.c
src/cli/babeltrace2-cfg.h
src/cli/babeltrace2.c
tests/cli/test_convert_args.in
This page took 0.026211 seconds and 4 git commands to generate.