Re: ospf6d: remove unneded log_setverbose()
On Mon, Jul 09, 2018 at 11:33:05AM +0200, Remi Locherer wrote: > On Mon, Jul 09, 2018 at 10:42:16AM +0200, Claudio Jeker wrote: > > On Mon, Jul 09, 2018 at 10:31:15AM +0200, Remi Locherer wrote: > > > later on it is set with: > > > log_setverbose(ospfd_conf->opts & OSPFD_OPT_VERBOSE); > > > > > > OK? > > > > Shouldn't we instead remove the log_setverbose(1) above the getopt call? > > I think the idea is that we want to be able to print debug messages > > between the early log_init() and the later one. > > In general that will allow debugging in parse_config() if -v is used. > > Yes, this makes sense to me. Also adapt ospfd. > > OK? OK claudio@ > > Index: ospf6d/ospf6d.c > === > RCS file: /cvs/src/usr.sbin/ospf6d/ospf6d.c,v > retrieving revision 1.35 > diff -u -p -r1.35 ospf6d.c > --- ospf6d/ospf6d.c 5 Nov 2017 16:56:02 - 1.35 > +++ ospf6d/ospf6d.c 9 Jul 2018 09:22:54 - > @@ -121,7 +121,6 @@ main(int argc, char *argv[]) > > log_init(1, LOG_DAEMON);/* log to stderr until daemonized */ > log_procinit(log_procnames[ospfd_process]); > - log_setverbose(1); > > while ((ch = getopt(argc, argv, "cdD:f:s:nv")) != -1) { > switch (ch) { > Index: ospfd/ospfd.c > === > RCS file: /cvs/src/usr.sbin/ospfd/ospfd.c,v > retrieving revision 1.97 > diff -u -p -r1.97 ospfd.c > --- ospfd/ospfd.c 11 Feb 2018 02:27:33 - 1.97 > +++ ospfd/ospfd.c 9 Jul 2018 09:26:54 - > @@ -123,7 +123,6 @@ main(int argc, char *argv[]) > > log_init(1, LOG_DAEMON);/* log to stderr until daemonized */ > log_procinit(log_procnames[ospfd_process]); > - log_setverbose(1); > > while ((ch = getopt(argc, argv, "cdD:f:ns:v")) != -1) { > switch (ch) { > @@ -151,6 +150,7 @@ main(int argc, char *argv[]) > if (opts & OSPFD_OPT_VERBOSE) > opts |= OSPFD_OPT_VERBOSE2; > opts |= OSPFD_OPT_VERBOSE; > + log_setverbose(1); > break; > default: > usage(); > -- :wq Claudio
Re: ospf6d: remove unneded log_setverbose()
On Mon, Jul 09 2018, Remi Locherer wrote: > On Mon, Jul 09, 2018 at 10:42:16AM +0200, Claudio Jeker wrote: >> On Mon, Jul 09, 2018 at 10:31:15AM +0200, Remi Locherer wrote: >> > later on it is set with: >> > log_setverbose(ospfd_conf->opts & OSPFD_OPT_VERBOSE); >> > >> > OK? >> >> Shouldn't we instead remove the log_setverbose(1) above the getopt call? >> I think the idea is that we want to be able to print debug messages >> between the early log_init() and the later one. >> In general that will allow debugging in parse_config() if -v is used. > > Yes, this makes sense to me. Also adapt ospfd. > > OK? ok jca@ -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE
Re: ospf6d: remove unneded log_setverbose()
On Mon, Jul 09, 2018 at 10:42:16AM +0200, Claudio Jeker wrote: > On Mon, Jul 09, 2018 at 10:31:15AM +0200, Remi Locherer wrote: > > later on it is set with: > > log_setverbose(ospfd_conf->opts & OSPFD_OPT_VERBOSE); > > > > OK? > > Shouldn't we instead remove the log_setverbose(1) above the getopt call? > I think the idea is that we want to be able to print debug messages > between the early log_init() and the later one. > In general that will allow debugging in parse_config() if -v is used. Yes, this makes sense to me. Also adapt ospfd. OK? Index: ospf6d/ospf6d.c === RCS file: /cvs/src/usr.sbin/ospf6d/ospf6d.c,v retrieving revision 1.35 diff -u -p -r1.35 ospf6d.c --- ospf6d/ospf6d.c 5 Nov 2017 16:56:02 - 1.35 +++ ospf6d/ospf6d.c 9 Jul 2018 09:22:54 - @@ -121,7 +121,6 @@ main(int argc, char *argv[]) log_init(1, LOG_DAEMON);/* log to stderr until daemonized */ log_procinit(log_procnames[ospfd_process]); - log_setverbose(1); while ((ch = getopt(argc, argv, "cdD:f:s:nv")) != -1) { switch (ch) { Index: ospfd/ospfd.c === RCS file: /cvs/src/usr.sbin/ospfd/ospfd.c,v retrieving revision 1.97 diff -u -p -r1.97 ospfd.c --- ospfd/ospfd.c 11 Feb 2018 02:27:33 - 1.97 +++ ospfd/ospfd.c 9 Jul 2018 09:26:54 - @@ -123,7 +123,6 @@ main(int argc, char *argv[]) log_init(1, LOG_DAEMON);/* log to stderr until daemonized */ log_procinit(log_procnames[ospfd_process]); - log_setverbose(1); while ((ch = getopt(argc, argv, "cdD:f:ns:v")) != -1) { switch (ch) { @@ -151,6 +150,7 @@ main(int argc, char *argv[]) if (opts & OSPFD_OPT_VERBOSE) opts |= OSPFD_OPT_VERBOSE2; opts |= OSPFD_OPT_VERBOSE; + log_setverbose(1); break; default: usage();
Re: ospf6d: remove unneded log_setverbose()
On Mon, Jul 09, 2018 at 10:31:15AM +0200, Remi Locherer wrote: > later on it is set with: > log_setverbose(ospfd_conf->opts & OSPFD_OPT_VERBOSE); > > OK? Shouldn't we instead remove the log_setverbose(1) above the getopt call? I think the idea is that we want to be able to print debug messages between the early log_init() and the later one. In general that will allow debugging in parse_config() if -v is used. > > Index: ospf6d.c > === > RCS file: /cvs/src/usr.sbin/ospf6d/ospf6d.c,v > retrieving revision 1.35 > diff -u -p -r1.35 ospf6d.c > --- ospf6d.c 5 Nov 2017 16:56:02 - 1.35 > +++ ospf6d.c 8 Jul 2018 12:59:38 - > @@ -149,7 +149,6 @@ main(int argc, char *argv[]) > if (opts & OSPFD_OPT_VERBOSE) > opts |= OSPFD_OPT_VERBOSE2; > opts |= OSPFD_OPT_VERBOSE; > - log_setverbose(1); > break; > default: > usage(); > > > -- :wq Claudio
ospf6d: remove unneded log_setverbose()
later on it is set with: log_setverbose(ospfd_conf->opts & OSPFD_OPT_VERBOSE); OK? Index: ospf6d.c === RCS file: /cvs/src/usr.sbin/ospf6d/ospf6d.c,v retrieving revision 1.35 diff -u -p -r1.35 ospf6d.c --- ospf6d.c5 Nov 2017 16:56:02 - 1.35 +++ ospf6d.c8 Jul 2018 12:59:38 - @@ -149,7 +149,6 @@ main(int argc, char *argv[]) if (opts & OSPFD_OPT_VERBOSE) opts |= OSPFD_OPT_VERBOSE2; opts |= OSPFD_OPT_VERBOSE; - log_setverbose(1); break; default: usage();