X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Flogging%2Fcomp-logging.h;h=3c0aca6d2e3daa857c7c5b9f2d2eaa51f5f312e5;hb=f6e68e70ef9f90225e18188c4b322a90dd54989d;hp=586486034cb990fb22ae68ad610e03a84093e93b;hpb=f0a9b634c286d3ee1dbad5eaffddc183d1cbfd7e;p=babeltrace.git diff --git a/src/logging/comp-logging.h b/src/logging/comp-logging.h index 58648603..3c0aca6d 100644 --- a/src/logging/comp-logging.h +++ b/src/logging/comp-logging.h @@ -271,4 +271,17 @@ } \ } while (0) +/* + * Logs error and appends error cause from message iterator context. + * + * There is no BT_SELF_MSG_LOGE yet, so use BT_COMP_LOGE for now. + */ +#define BT_MSG_ITER_LOGE_APPEND_CAUSE(_self_msg_iter, _fmt, ...) \ + do { \ + BT_COMP_LOG(BT_LOG_ERROR, bt_self_message_iterator_borrow_component(_self_msg_iter), \ + _fmt, ##__VA_ARGS__); \ + (void) BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_MESSAGE_ITERATOR( \ + _self_msg_iter, _fmt, ##__VA_ARGS__); \ + } while (0) + #endif /* BABELTRACE_LOGGING_COMP_LOGGING_H */