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)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 20 Jun 2019 18:01:16 +0000 (14:01 -0400)
commit29da2ffc1a78f1b25fccc6b6cab66e5883a6603d
tree5410ba69ab00f3831df23826a01d4c9979890d59
parent9957b01aeb665bb0e7cfcf5e826048d956ceef65
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.025913 seconds and 4 git commands to generate.