X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Fnative_bt_log_and_append_error.h;h=f3b57bca388ca06004b67320983983a8da2b6980;hb=c4f23e30bf67d2523163614bc9461d84cbe1ae80;hp=11b6e414e1ec435e99a7575c912e84eabc2cb090;hpb=84e438afc1b27f23047613c413e2caec283af065;p=babeltrace.git diff --git a/src/bindings/python/bt2/bt2/native_bt_log_and_append_error.h b/src/bindings/python/bt2/bt2/native_bt_log_and_append_error.h index 11b6e414..f3b57bca 100644 --- a/src/bindings/python/bt2/bt2/native_bt_log_and_append_error.h +++ b/src/bindings/python/bt2/bt2/native_bt_log_and_append_error.h @@ -22,6 +22,8 @@ * THE SOFTWARE. */ +#include + #include "logging/comp-logging.h" static @@ -228,15 +230,17 @@ bt_logging_level get_self_message_iterator_log_level( } static inline -void loge_exception_append_cause(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_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_cause(BT_LOG_WARNING, active_log_level, false, NULL, NULL, NULL, NULL); + PyErr_Clear(); }