From bc9f2d8687625b7eafd70b9afba9fa71983a640a Mon Sep 17 00:00:00 2001 From: Wynn Wolf Arbor Date: Tue, 26 Jan 2021 20:48:13 +0100 Subject: Do not send debug messages to syslog by default This partially reverts 56691b1 (Allow specifying -d multiple times, 2020-05-11). In that commit, a check for the debug variable in syslog_debug was removed because a debug level of > 0 would have slowcgi log to the console instead of syslog, making the check pointless. However, this also means that slowcgi will now print debug messages by default, even if run without the '-d' flag. The commit messages states that the syslog daemon should handle debug output instead. We feel that this is unsound reasoning, and that it goes against a de-facto standard seen in the wild so far: only issue debug output (whether to console or not), if specifically asked for. Therefore, reintroduce the check for the debug variable. Whilst this will in fact make the whole syslog_debug method pointless, we do not want to commit to a complete rewrite of the debug functionality at this time (even if such an undertaking is, in our opinion, warranted). --- slowcgi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/slowcgi.c b/slowcgi.c index 0b5d62a..307b259 100644 --- a/slowcgi.c +++ b/slowcgi.c @@ -1314,6 +1314,9 @@ syslog_debug(const char *fmt, ...) { va_list ap; + if (!debug) + return; + va_start(ap, fmt); vsyslog(LOG_DEBUG, fmt, ap); va_end(ap); -- cgit v1.2.3-2-gb3c3