From: Simon Ruderich Date: Mon, 29 Jul 2013 10:35:38 +0000 (+0200) Subject: Log messages to stderr. X-Git-Url: https://ruderich.org/simon/gitweb/?p=tlsproxy%2Ftlsproxy.git;a=commitdiff_plain;h=c31033a5fe1af1632a11c03de2290650ba8a82c6 Log messages to stderr. --- diff --git a/src/log.c b/src/log.c index 05acddf..a791450 100644 --- a/src/log.c +++ b/src/log.c @@ -46,9 +46,9 @@ void log_message(int level, const char *file, int line, const char *format, ...) #endif /* Prevent another thread from interrupting the two printfs(). */ - flockfile(stdout); + flockfile(stderr); - fprintf(stdout, + fprintf(stderr, #ifdef DEBUG "%-12s:%-3d " #endif @@ -58,9 +58,9 @@ void log_message(int level, const char *file, int line, const char *format, ...) #endif level_string, (int)pthread_self()); va_start(ap, format); - vfprintf(stdout, format, ap); + vfprintf(stderr, format, ap); va_end(ap); - fprintf(stdout, "\n"); + fprintf(stderr, "\n"); - funlockfile(stdout); + funlockfile(stderr); }