From: Simon Marchi Date: Mon, 21 Oct 2019 19:56:42 +0000 (-0400) Subject: lib: add _msg parameters to _ERRNO logging macros X-Git-Tag: v2.0.0-rc2~59 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=f5896b6fb04016514b737e800d0d0a9fa6eb4eb2 lib: add _msg parameters to _ERRNO logging macros The macros BT_COMP_LOGE_APPEND_CAUSE_ERRNO and BT_COMP_CLASS_LOGE_APPEND_CAUSE_ERRNO are missing the `_msg` parameter that other _ERRNO macros have. It still works, because the following parameters are passed through the variable arguments, but it makes the macro unnecessarily complicated to use. Change-Id: Iabb89a24da1641c67b9843c8337aec709c7b3e08 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/2229 Tested-by: jenkins Reviewed-by: Francis Deslauriers --- diff --git a/src/logging/comp-logging.h b/src/logging/comp-logging.h index 934e8487..1edabc00 100644 --- a/src/logging/comp-logging.h +++ b/src/logging/comp-logging.h @@ -166,8 +166,8 @@ * Logs error and appends error cause from component context - the errno * edition. */ -#define BT_COMP_LOGE_APPEND_CAUSE_ERRNO(_self_comp, _fmt, ...) \ - BT_COMP_LOG_APPEND_CAUSE_ERRNO(_self_comp, BT_LOG_ERROR, _fmt, ##__VA_ARGS__) +#define BT_COMP_LOGE_APPEND_CAUSE_ERRNO(_self_comp, _msg, _fmt, ...) \ + BT_COMP_LOG_APPEND_CAUSE_ERRNO(_self_comp, BT_LOG_ERROR, _msg, _fmt, ##__VA_ARGS__) /* Logs and appends error cause from component class context. */ #define BT_COMP_CLASS_LOG_APPEND_CAUSE(_self_comp_class, _lvl, _fmt, ...) \ @@ -198,8 +198,8 @@ * Logs error and appends error cause from component class context - the errno * edition. */ -#define BT_COMP_CLASS_LOGE_APPEND_CAUSE_ERRNO(_self_comp_class, _fmt, ...) \ - BT_COMP_CLASS_LOG_APPEND_CAUSE_ERRNO(_self_comp_class, BT_LOG_ERROR, _fmt, \ +#define BT_COMP_CLASS_LOGE_APPEND_CAUSE_ERRNO(_self_comp_class, _msg, _fmt, ...) \ + BT_COMP_CLASS_LOG_APPEND_CAUSE_ERRNO(_self_comp_class, BT_LOG_ERROR, _msg, _fmt, \ ##__VA_ARGS__) /*