X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=src%2Flog.c;fp=src%2Flog.c;h=e00a08d8aa77f9a2914ce39fee3821c97bd87e97;hb=a64101800c79c852cc4ab9d445c35aad0a6457eb;hp=5d05e4addf461c05f5cdae8302e2037cd2badd17;hpb=d778944d0403b093d43d9cbd94bd298bfc3a8d42;p=tlsproxy%2Ftlsproxy.git diff --git a/src/log.c b/src/log.c index 5d05e4a..e00a08d 100644 --- a/src/log.c +++ b/src/log.c @@ -41,14 +41,22 @@ void log_message(int level, const char *file, int line, const char *format, ...) default: level_string = "UNKNOWN"; } - va_start(ap, format); -#ifdef DEBUG - fprintf(stdout, "%-12s:%-3d ", file, line); -#else +#ifndef DEBUG + /* Prevent warnings. */ (void)file; (void)line; #endif - fprintf(stdout, "[%s] [%d] ", level_string, (int)pthread_self()); + + va_start(ap, format); + fprintf(stdout, +#ifdef DEBUG + "%-12s:%-3d " +#endif + "[%s] [%d] ", +#ifdef DEBUG + file, line, +#endif + level_string, (int)pthread_self()); vfprintf(stdout, format, ap); fprintf(stdout, "\n"); va_end(ap);