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 <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-09-08 16:17:04 +02:00
parent f8a352f316
commit 667f5d16f6

View File

@ -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, ...) \