Big header file cleanup: everything that has to do with standard system
[tinc] / src / logger.h
index ec5f52f..615d0c3 100644 (file)
@@ -1,8 +1,5 @@
 #ifndef __TINC_LOGGER_H__
 
-#include <syslog.h>
-#include <stdarg.h>
-
 enum {
        DEBUG_NOTHING = 0,                      /* Quiet mode, only show starting/stopping of the daemon */
        DEBUG_ALWAYS = 0,
@@ -23,21 +20,11 @@ enum {
        LOGMODE_SYSLOG
 };
 
-extern volatile int debug_level;
+extern int debug_level;
 extern void openlogger(const char *, int);
-extern void vlogger(int, const char *, va_list ap);
+extern void logger(int, const char *, ...) __attribute__ ((format(printf, 2, 3)));
 extern void closelogger(void);
 
-/* Inline logger function because it's used quite often */
-
-static inline void logger(int level, int priority, const char *format, ...) {
-       va_list ap;
-
-       if(level == DEBUG_ALWAYS || debug_level >= level) {
-               va_start(ap, format);
-               vlogger(priority, format, ap);
-               va_end(ap);
-       }
-}
+#define ifdebug(l) if(debug_level >= DEBUG_##l)
 
 #endif /* __TINC_LOGGER_H__ */