From: Vincent Bernat Date: Tue, 8 Jul 2014 19:41:48 +0000 (+0200) Subject: log: info messages should be logged on syslog but not on first debug level X-Git-Tag: 0.7.10~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e595efb4c17771a714b64db1d7255b8fc1315cc7;p=thirdparty%2Flldpd.git log: info messages should be logged on syslog but not on first debug level Without `-d`, syslog should log info messages. With `-d`, they should not be displayed. With `-dd`, they should be displayed. This is an amendment of the previous patch. --- diff --git a/src/log.c b/src/log.c index 4a1647e7..07ea08f2 100644 --- a/src/log.c +++ b/src/log.c @@ -195,9 +195,11 @@ log_info(const char *token, const char *emsg, ...) { va_list ap; - va_start(ap, emsg); - vlog(LOG_INFO, token, emsg, ap); - va_end(ap); + if (!debug || debug > 1 || logh) { + va_start(ap, emsg); + vlog(LOG_INFO, token, emsg, ap); + va_end(ap); + } } static int