Cleanup: add `#include <stdbool.h>` whenever `bool` type is used
[babeltrace.git] / src / bindings / python / bt2 / bt2 / native_bt_log_and_append_error.h
index 37cc2e78ac6484bb93880d51a8916d88139bb017..f3b57bca388ca06004b67320983983a8da2b6980 100644 (file)
@@ -22,6 +22,8 @@
  * THE SOFTWARE.
  */
 
+#include <stdbool.h>
+
 #include "logging/comp-logging.h"
 
 static
@@ -176,8 +178,10 @@ void restore_bt_error_and_append_current_exception_chain(
 }
 
 static inline
-void log_exception_and_maybe_append_error(int func_log_level,
-               int active_log_level, bool append_error,
+void log_exception_and_maybe_append_cause(
+               int func_log_level,
+               int active_log_level,
+               bool append_error,
                bt_self_component_class *self_component_class,
                bt_self_component *self_component,
                bt_self_message_iterator *self_message_iterator,
@@ -226,15 +230,17 @@ bt_logging_level get_self_message_iterator_log_level(
 }
 
 static inline
-void loge_exception(const char *module_name, int active_log_level)
+void loge_exception_append_cause_clear(const char *module_name, int active_log_level)
 {
-       log_exception_and_maybe_append_error(BT_LOG_ERROR, active_log_level,
+       log_exception_and_maybe_append_cause(BT_LOG_ERROR, active_log_level,
                true, NULL, NULL, NULL, module_name);
+       PyErr_Clear();
 }
 
 static inline
-void logw_exception(int active_log_level)
+void logw_exception_clear(int active_log_level)
 {
-       log_exception_and_maybe_append_error(BT_LOG_WARNING, active_log_level,
+       log_exception_and_maybe_append_cause(BT_LOG_WARNING, active_log_level,
                false, NULL, NULL, NULL, NULL);
+       PyErr_Clear();
 }
This page took 0.024578 seconds and 4 git commands to generate.