]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Add i_log_typev()
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 13 Nov 2017 14:08:15 +0000 (16:08 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 13 Dec 2017 11:04:27 +0000 (13:04 +0200)
src/lib/failures.c
src/lib/failures.h

index 7494f7c436f65780694cc9f4c4183193dc7ad23f..10ed8e95f754fa5810c9d16d7158717f84cb613c 100644 (file)
@@ -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, ...)
index 4ab6735a6a867c8080d17842638dce8eb71cb9e4..e2bd20f2ad67c3337e74f5688c80a98d046445d2 100644 (file)
@@ -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;