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_logging_level
) bt_python_bindings_bt2_log_level
,
17 BT_COMMON_COLOR_WHEN_NEVER
);
18 BT_ASSERT(error_cause_str
);
20 py_error_cause_str
= PyString_FromString(error_cause_str
);
22 g_free(error_cause_str
);
24 return py_error_cause_str
;
28 PyObject
*bt_bt2_format_bt_error(const bt_error
*error
)
31 PyObject
*py_error_str
= NULL
;
33 error_str
= format_bt_error(error
, 80,
34 (bt_logging_level
) bt_python_bindings_bt2_log_level
,
35 BT_COMMON_COLOR_WHEN_NEVER
);
38 py_error_str
= PyString_FromString(error_str
);