From 667f5d16f666ae841066b574a6986223b4cb9470 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sat, 8 Sep 2012 16:17:04 +0200 Subject: [PATCH] log: add log_dummyf() helper Instead of doing nothing we now pass everything to log_dummyf() if a logging macro is not enabled. This silences all the "unused variable" warnings which are really annoying. Signed-off-by: David Herrmann --- src/log.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/log.h b/src/log.h index 909157a..b073ae3 100644 --- a/src/log.h +++ b/src/log.h @@ -205,6 +205,10 @@ void log_llog(const char *file, int log_set_file(const char *file); void log_print_init(const char *appname); +static inline void log_dummyf(unsigned int sev, const char *format, ...) +{ +} + /* * Default values * All helpers automatically pick-up the file, line, func, config and subsystem @@ -262,7 +266,8 @@ extern const char *LOG_SUBSYSTEM; #define log_debug(format, ...) \ log_printf(LOG_DEBUG, (format), ##__VA_ARGS__) #else - #define log_debug(format, ...) + #define log_debug(format, ...) \ + log_dummyf(LOG_DEBUG, (format), ##__VA_ARGS__) #endif #define log_info(format, ...) \