From 86632a91eb65d6b3df7bcdaebef3e1ea4e3a568a Mon Sep 17 00:00:00 2001 From: rofl0r Date: Sun, 25 Feb 2018 17:59:24 +0000 Subject: fix early logging tinyproxy uses a curious mechanism to log those early messages that result from parsing the config file before the logging mechanism has been properly set up yet by finishing parsing of the config file: those early messages are written into a memory buffer and then are printed later on. this slipped my attention when making it possible to log to stdout in ccbbb81a. --- src/log.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/log.c b/src/log.c index 69b6dc0..f85d29d 100644 --- a/src/log.c +++ b/src/log.c @@ -115,9 +115,6 @@ void log_message (int level, const char *fmt, ...) ssize_t ret; - if(!config.syslog && log_file_fd == -1) - return; - #ifdef NDEBUG /* * Figure out if we should write the message or not. @@ -164,6 +161,9 @@ void log_message (int level, const char *fmt, ...) goto out; } + if(!config.syslog && log_file_fd == -1) + goto out; + if (config.syslog) { #ifdef HAVE_VSYSLOG_H vsyslog (level, fmt, args); -- cgit v1.2.3