Smarter logging - once again. Ready to run it for real now. Fingers crossed...
[distributedratelimiting.git] / drl / logging.c
index ca3d7c1..23a6f59 100644 (file)
@@ -7,9 +7,9 @@ FILE *logfile;
 uint8_t system_loglevel;
 
 inline void printlog(const uint8_t level, const char *format, ...) {
-    va_list args;
-
     if (system_loglevel <= level) {
+        va_list args;
+
         va_start(args, format);
         vfprintf(logfile, format, args);
         va_end(args);