From: Timo Sirainen Date: Mon, 13 Nov 2017 14:08:15 +0000 (+0200) Subject: lib: Add i_log_typev() X-Git-Tag: 2.3.0.rc1~103 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8009758e97922663d9a375a52efe044c8fe4d462;p=thirdparty%2Fdovecot%2Fcore.git lib: Add i_log_typev() --- diff --git a/src/lib/failures.c b/src/lib/failures.c index 7494f7c436..10ed8e95f7 100644 --- a/src/lib/failures.c +++ b/src/lib/failures.c @@ -271,7 +271,13 @@ void i_log_type(const struct failure_context *ctx, const char *format, ...) va_list args; va_start(args, format); + i_log_typev(ctx, format, args); + va_end(args); +} +void i_log_typev(const struct failure_context *ctx, const char *format, + va_list args) +{ switch (ctx->type) { case LOG_TYPE_DEBUG: debug_handler(ctx, format, args); @@ -282,8 +288,6 @@ void i_log_type(const struct failure_context *ctx, const char *format, ...) default: error_handler(ctx, format, args); } - - va_end(args); } void i_panic(const char *format, ...) diff --git a/src/lib/failures.h b/src/lib/failures.h index 4ab6735a6a..e2bd20f2ad 100644 --- a/src/lib/failures.h +++ b/src/lib/failures.h @@ -49,6 +49,8 @@ extern const char *failure_log_type_names[]; void i_log_type(const struct failure_context *ctx, const char *format, ...) ATTR_FORMAT(2, 3); +void i_log_typev(const struct failure_context *ctx, const char *format, + va_list args) ATTR_FORMAT(2, 0); void i_panic(const char *format, ...) ATTR_FORMAT(1, 2) ATTR_NORETURN ATTR_COLD; void i_fatal(const char *format, ...) ATTR_FORMAT(1, 2) ATTR_NORETURN ATTR_COLD;