cli: Replace printf_err with BT_CLI_LOGE_APPEND_CAUSE
The printf_err macro is currently used to report an error in the CLI.
However, we now have a proper error reporting framework. This patches
makes the CLI use it.
All usages of printf_err are replaced with BT_CLI_LOGE_APPEND_CAUSE.
All usages of print_err_oom are replaced with a new macro that calls
BT_CLI_LOGE_APPEND_CAUSE("Out of memory.").
I haven't tested all the errors paths to make sure they worked well, but
here are some examples of the result:
$ babeltrace2 convert --run-args --legault
ERROR: [Babeltrace CLI] (/home/smarchi/src/babeltrace/src/cli/babeltrace2.c:2874)
Command-line error: retcode=1
CAUSED BY [Babeltrace CLI] (/home/smarchi/src/babeltrace/src/cli/babeltrace2-cfg-cli-args.c:3621)
While parsing command-line options, at option --legault: unknown option
$ babeltrace2 convert --run-args -i salut
ERROR: [Babeltrace CLI] (/home/smarchi/src/babeltrace/src/cli/babeltrace2.c:2874)
Command-line error: retcode=1
CAUSED BY [Babeltrace CLI] (/home/smarchi/src/babeltrace/src/cli/babeltrace2-cfg-cli-args.c:3834)
Unknown legacy input format:
salut
Change-Id: I891c0518c66f61a62fd2e73cf3c438b622aabd9a
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1692
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
This page took 0.026587 seconds and 4 git commands to generate.