Use RTE_LOG_LINE_PREFIX instead of RTE_LOG_LINE in macro expansions which allow a prefix and arguments to be inserted into the log line without the need to use the ## args variadic argument pack extension.
Signed-off-by: Tyler Retzlaff <roret...@linux.microsoft.com> --- lib/stack/stack_pvt.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/stack/stack_pvt.h b/lib/stack/stack_pvt.h index 2dce42a..fc95796 100644 --- a/lib/stack/stack_pvt.h +++ b/lib/stack/stack_pvt.h @@ -10,16 +10,16 @@ extern int stack_logtype; #define RTE_LOGTYPE_STACK stack_logtype -#define STACK_LOG(level, fmt, args...) \ - RTE_LOG_LINE(level, STACK, "%s(): "fmt, __func__, ##args) +#define STACK_LOG(level, ...) \ + RTE_LOG_LINE_PREFIX(level, STACK, "%s(): ", __func__, __VA_ARGS__) -#define STACK_LOG_ERR(fmt, args...) \ - STACK_LOG(ERR, fmt, ## args) +#define STACK_LOG_ERR(...) \ + STACK_LOG(ERR, __VA_ARGS__) -#define STACK_LOG_WARN(fmt, args...) \ - STACK_LOG(WARNING, fmt, ## args) +#define STACK_LOG_WARN(...) \ + STACK_LOG(WARNING, __VA_ARGS__) -#define STACK_LOG_INFO(fmt, args...) \ - STACK_LOG(INFO, fmt, ## args) +#define STACK_LOG_INFO(fmt, ...) \ + STACK_LOG(INFO, __VA_ARGS__) #endif /* _STACK_PVT_H_ */ -- 1.8.3.1