From 6f9fced0577a8d7c6f0eb5e7b57f3ffce036cc8c Mon Sep 17 00:00:00 2001 From: Christian Hopps Date: Sat, 25 Jan 2025 06:39:08 +0000 Subject: [PATCH] lib: add extern available variadic zlog function Signed-off-by: Christian Hopps --- lib/zlog.c | 13 +++++++++++-- lib/zlog.h | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/zlog.c b/lib/zlog.c index ffca572609..ce63227a5c 100644 --- a/lib/zlog.c +++ b/lib/zlog.c @@ -685,8 +685,17 @@ static void zlog_backtrace_msg(const struct xref_logmsg *xref, int prio) tc->xref->xref.line); } -void vzlogx(const struct xref_logmsg *xref, int prio, - const char *fmt, va_list ap) +PRINTFRR(2, 3) +void ezlog(int prio, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vzlog(prio, fmt, ap); + va_end(ap); +} + +void vzlogx(const struct xref_logmsg *xref, int prio, const char *fmt, va_list ap) { struct zlog_tls *zlog_tls = zlog_tls_get(); diff --git a/lib/zlog.h b/lib/zlog.h index 9d93979957..d19acef5c7 100644 --- a/lib/zlog.h +++ b/lib/zlog.h @@ -64,6 +64,8 @@ extern void vzlogx(const struct xref_logmsg *xref, int prio, const char *fmt, va_list ap) PRINTFRR(3, 0); #define vzlog(prio, ...) vzlogx(NULL, prio, __VA_ARGS__) +extern void ezlog(int prio, const char *fmt, ...) PRINTFRR(2, 3); + PRINTFRR(2, 3) static inline void zlog(int prio, const char *fmt, ...) { -- 2.39.5