diff --git a/log.c b/log.c index 7acbd019..348b6db4 100644 --- a/log.c +++ b/log.c @@ -40,7 +40,8 @@ /* #define REPMGR_DEBUG */ static int detect_log_facility(const char *facility); -static void _stderr_log_with_level(const char *level_name, int level, const char *fmt, va_list ap); +static void _stderr_log_with_level(const char *level_name, int level, const char *fmt, va_list ap) +__attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 0))); int log_type = REPMGR_STDERR; int log_level = LOG_NOTICE; @@ -48,7 +49,7 @@ int last_log_level = LOG_NOTICE; int verbose_logging = false; int terse_logging = false; -void +extern void stderr_log_with_level(const char *level_name, int level, const char *fmt, ...) { va_list arglist; diff --git a/log.h b/log.h index 8d1cf10f..e717be98 100644 --- a/log.h +++ b/log.h @@ -25,7 +25,7 @@ #define REPMGR_SYSLOG 1 #define REPMGR_STDERR 2 -void +extern void stderr_log_with_level(const char *level_name, int level, const char *fmt,...) __attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 4))); @@ -123,8 +123,10 @@ bool logger_shutdown(void); void logger_set_verbose(void); void logger_set_terse(void); -void log_hint(const char *fmt, ...); -void log_verbose(int level, const char *fmt, ...); +void log_hint(const char *fmt, ...) +__attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2))); +void log_verbose(int level, const char *fmt, ...) +__attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3))); extern int log_type; extern int log_level;