cli: apply log levels (`--log-level` option) to leftovers
It is currently not possible to apply --log-level after a leftover.
This patch proposes a way to allow it and to deal with the ambiguity
that it poses.
In the simple case, we have:
babeltrace2 my-traces --log-level=TRACE
All source components auto-discovered from the `my-traces` leftover will
have the TRACE log level.
If we have more than one leftover, but _no_ cross-leftover grouping,
then it is also intuitive:
babeltrace2 my-traces-1 --log-level=TRACE my-traces-2 --log-level=DEBUG
... all source components discovered from `my-traces-1` will have log
level TRACE and all source components discovered from `my-traces-2` will
have log level DEBUG.
It becomes less obvious when components are given inputs coming from
multiple leftovers (because of the auto-discovery grouping feature):
which log level do they receive? For example, if the following line:
babeltrace2 my-traces-1 --log-level=TRACE my-traces-2 --log-level=DEBUG
leads to these components getting instantiated, with these inputs:
* Source component X with inputs `my-traces-1/x` and `my-traces-2/x`.
* Source component Y with input `my-traces-1/y`
In this case, each component receives (on the `run` command line) the
log level options of all leftovers that contributed to its inputs, in
the same order as they are provided on the command line. The resulting
`run` command line for the example above could therefore look like:
... --component x:src.my.comp --log-level=TRACE --log-level=DEBUG \
--component y:src.my.comp --log-level=TRACE
resulting in these effective log levels:
* Source component X: log level DEBUG
* Source component Y: log level TRACE
Change-Id: I5e1bf9e1b4dd139ff7900d81b302a1eda72fb37f
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1810
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
14 files changed:
This page took 0.028398 seconds and 4 git commands to generate.