]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
log: info messages should be logged on syslog but not on first debug level
authorVincent Bernat <vincent@bernat.im>
Tue, 8 Jul 2014 19:41:48 +0000 (21:41 +0200)
committerVincent Bernat <vincent@bernat.im>
Tue, 8 Jul 2014 19:41:48 +0000 (21:41 +0200)
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.

src/log.c

index 4a1647e7548bda8391b9c8e1ed2d60950661e91b..07ea08f20e5248285431d386c283ec7f0bf0a43a 100644 (file)
--- 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