From: Christian Hopps Date: Sat, 25 Jan 2025 06:39:08 +0000 (+0000) Subject: lib: add extern available variadic zlog function X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=6f9fced0577a8d7c6f0eb5e7b57f3ffce036cc8c;p=matthieu%2Ffrr.git lib: add extern available variadic zlog function Signed-off-by: Christian Hopps --- 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, ...) {