2 * SPDX-License-Identifier: MIT
4 * Copyright (c) 2019 Efficios, Inc.
7 #ifndef BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_ERROR_I_H
8 #define BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_ERROR_I_H
10 #include <string-format/format-error.h>
13 PyObject
*bt_bt2_format_bt_error_cause(const bt_error_cause
*error_cause
)
15 gchar
*error_cause_str
;
16 PyObject
*py_error_cause_str
= NULL
;
18 error_cause_str
= format_bt_error_cause(error_cause
, 80,
19 (bt_logging_level
) bt_python_bindings_bt2_log_level
,
20 BT_COMMON_COLOR_WHEN_NEVER
);
21 BT_ASSERT(error_cause_str
);
23 py_error_cause_str
= PyString_FromString(error_cause_str
);
25 g_free(error_cause_str
);
27 return py_error_cause_str
;
31 PyObject
*bt_bt2_format_bt_error(const bt_error
*error
)
34 PyObject
*py_error_str
= NULL
;
36 error_str
= format_bt_error(error
, 80,
37 (bt_logging_level
) bt_python_bindings_bt2_log_level
,
38 BT_COMMON_COLOR_WHEN_NEVER
);
41 py_error_str
= PyString_FromString(error_str
);
48 #endif /* BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_ERROR_I_H */