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)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 5 Dec 2019 19:29:13 +0000 (19:29 +0000)
commit5038e25680486da1eb36b0f8f020e6609618dda1
tree66bc5fcf7d57fb271c841d9dafc9256492c5c2ef
parent30b828d2858e5b3823f0b36a01563855564d8c19
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.025984 seconds and 4 git commands to generate.