passt: Move __setlogmask() calls before output unrelated to configuration
...so that we avoid printing some lines twice because log-level is still set to LOG_EMERG, as if logging configuration didn't happen yet. While at it, note that logging to stderr doesn't really depend on whether debug mode is enabled or not. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
198f87835d
commit
6533a4a07b
1 changed files with 8 additions and 8 deletions
16
passt.c
16
passt.c
|
@ -243,9 +243,16 @@ int main(int argc, char **argv)
|
|||
conf(&c, argc, argv);
|
||||
trace_init(c.trace);
|
||||
|
||||
if (!c.debug && (c.stderr || isatty(fileno(stdout))))
|
||||
if (c.stderr || isatty(fileno(stdout)))
|
||||
__openlog(log_name, LOG_PERROR, LOG_DAEMON);
|
||||
|
||||
if (c.debug)
|
||||
__setlogmask(LOG_UPTO(LOG_DEBUG));
|
||||
else if (c.quiet)
|
||||
__setlogmask(LOG_UPTO(LOG_ERR));
|
||||
else
|
||||
__setlogmask(LOG_UPTO(LOG_INFO));
|
||||
|
||||
quit_fd = pasta_netns_quit_init(&c);
|
||||
|
||||
c.fd_tap = c.fd_tap_listen = -1;
|
||||
|
@ -267,13 +274,6 @@ int main(int argc, char **argv)
|
|||
if (c.ifi6 && !c.no_dhcpv6)
|
||||
dhcpv6_init(&c);
|
||||
|
||||
if (c.debug)
|
||||
__setlogmask(LOG_UPTO(LOG_DEBUG));
|
||||
else if (c.quiet)
|
||||
__setlogmask(LOG_UPTO(LOG_ERR));
|
||||
else
|
||||
__setlogmask(LOG_UPTO(LOG_INFO));
|
||||
|
||||
pcap_init(&c);
|
||||
|
||||
if (!c.foreground) {
|
||||
|
|
Loading…
Reference in a new issue