bt2: use format_bt_error and format_bt_error_cause to generate _Error and _ErrorCause...
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 22 Nov 2019 13:31:24 +0000 (08:31 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 20 Jan 2020 20:15:24 +0000 (15:15 -0500)
commit7d30475f16814c503a3f3188de7bc85dd029d887
treed4aa3d5c848c46f0da2d9c5db7a2ef5717edd11f
parent2efcc711c0d55d090def3c10365cd87c2a2e5511
bt2: use format_bt_error and format_bt_error_cause to generate _Error and _ErrorCause string representations

This makes it so that formatting bt2._Error as a string looks the same
way as what is printed by the CLI.  It also allows formatting of error
causes individually.

The __str__ methods generate string representations that do not include
terminal color control characters. If we want, we could later add a
"to_string" method that can optionally generate a string with terminal
color control characters.

Change-Id: I9e2c6db536a1bea46b07c5fe8bb13f702d8accce
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2435
Tested-by: jenkins <jenkins@lttng.org>
src/bindings/python/bt2/Makefile.am
src/bindings/python/bt2/bt2/error.py
src/bindings/python/bt2/bt2/native_bt_error.i
src/bindings/python/bt2/bt2/native_bt_error.i.h [new file with mode: 0644]
src/bindings/python/bt2/setup.py.in
tests/bindings/python/bt2/test_error.py
This page took 0.025848 seconds and 4 git commands to generate.