2 * SPDX-License-Identifier: MIT
4 * Copyright (c) 2019 Efficios, Inc.
7 #include <string-format/format-error.h>
10 PyObject
*bt_bt2_format_bt_error_cause(const bt_error_cause
*error_cause
)
12 gchar
*error_cause_str
;
13 PyObject
*py_error_cause_str
= NULL
;
15 error_cause_str
= format_bt_error_cause(error_cause
, 80,
16 bt_python_bindings_bt2_log_level
, BT_COMMON_COLOR_WHEN_NEVER
);
17 BT_ASSERT(error_cause_str
);
19 py_error_cause_str
= PyString_FromString(error_cause_str
);
21 g_free(error_cause_str
);
23 return py_error_cause_str
;
27 PyObject
*bt_bt2_format_bt_error(const bt_error
*error
)
30 PyObject
*py_error_str
= NULL
;
32 error_str
= format_bt_error(error
, 80,
33 bt_python_bindings_bt2_log_level
, BT_COMMON_COLOR_WHEN_NEVER
);
36 py_error_str
= PyString_FromString(error_str
);