diff mbox series

[ndctl,1/2] ndctl, monitor: fix the severity of the "daemon started" message

Message ID 20181005000057.30186-1-vishal.l.verma@intel.com (mailing list archive)
State New, archived
Headers show
Series [ndctl,1/2] ndctl, monitor: fix the severity of the "daemon started" message | expand

Commit Message

Verma, Vishal L Oct. 5, 2018, midnight UTC
The above message was printed as an error, but it is just an
informational message. Change it to dbg().

Cc: QI Fuli <qi.fuli@jp.fujitsu.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 ndctl/monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dan Williams Oct. 5, 2018, 12:04 a.m. UTC | #1
On Thu, 2018-10-04 at 18:00 -0600, Vishal Verma wrote:
> The above message was printed as an error, but it is just an
> informational message. Change it to dbg().
> 
> Cc: QI Fuli <qi.fuli@jp.fujitsu.com>
> Cc: Dan Williams <dan.j.williams@intel.com>

Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Gotou, Yasunori/五島 康文 Oct. 5, 2018, 4:08 a.m. UTC | #2
Hi, Vishal-san,

> The above message was printed as an error, but it is just an
> informational message. Change it to dbg().

Hmmmmmmm.

When I was a engineer for trouble-shooting of customer's Linux system,
the starting time and the ending time of any daemon was very helpful
for investigating their trouble.

So, I think it is not only for developer, but also it is essential for
trouble-shooter for custmer support. 
(It may be also same with system operator)


> 
> Cc: QI Fuli <qi.fuli@jp.fujitsu.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> ---
>  ndctl/monitor.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ndctl/monitor.c b/ndctl/monitor.c
> index d29e378..b44f946 100644
> --- a/ndctl/monitor.c
> +++ b/ndctl/monitor.c
> @@ -660,7 +660,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)
>  			err((struct ndctl_ctx *)ctx, "daemon start failed\n");
>  			goto out;
>  		}
> -		err((struct ndctl_ctx *)ctx, "ndctl monitor daemon started\n");
> +		dbg((struct ndctl_ctx *)ctx, "ndctl monitor daemon started\n");

Though I agree its message is not "error" certainly,
I would like to keep it as normal status level message.

Thanks,
---
Yasunori Goto
Dan Williams Oct. 5, 2018, 4:23 a.m. UTC | #3
On Thu, Oct 4, 2018 at 9:09 PM Yasunori Goto <y-goto@jp.fujitsu.com> wrote:
>
> Hi, Vishal-san,
>
> > The above message was printed as an error, but it is just an
> > informational message. Change it to dbg().
>
> Hmmmmmmm.
>
> When I was a engineer for trouble-shooting of customer's Linux system,
> the starting time and the ending time of any daemon was very helpful
> for investigating their trouble.
>
> So, I think it is not only for developer, but also it is essential for
> trouble-shooter for custmer support.
> (It may be also same with system operator)
>
>
> >
> > Cc: QI Fuli <qi.fuli@jp.fujitsu.com>
> > Cc: Dan Williams <dan.j.williams@intel.com>
> > Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> > ---
> >  ndctl/monitor.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/ndctl/monitor.c b/ndctl/monitor.c
> > index d29e378..b44f946 100644
> > --- a/ndctl/monitor.c
> > +++ b/ndctl/monitor.c
> > @@ -660,7 +660,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)
> >                       err((struct ndctl_ctx *)ctx, "daemon start failed\n");
> >                       goto out;
> >               }
> > -             err((struct ndctl_ctx *)ctx, "ndctl monitor daemon started\n");
> > +             dbg((struct ndctl_ctx *)ctx, "ndctl monitor daemon started\n");
>
> Though I agree its message is not "error" certainly,
> I would like to keep it as normal status level message.
>

Sounds good to me.
QI Fuli Oct. 5, 2018, 4:59 a.m. UTC | #4
> -----Original Message-----
> From: Linux-nvdimm [mailto:linux-nvdimm-bounces@lists.01.org] On Behalf Of Dan
> Williams
> Sent: Friday, October 5, 2018 1:24 PM
> To: Gotou, Yasunori/五島 康文 <y-goto@jp.fujitsu.com>
> Cc: andreas@canonical.com; linux-nvdimm <linux-nvdimm@lists.01.org>
> Subject: Re: [ndctl PATCH 1/2] ndctl, monitor: fix the severity of the "daemon
> started" message
> 
> On Thu, Oct 4, 2018 at 9:09 PM Yasunori Goto <y-goto@jp.fujitsu.com> wrote:
> >
> > Hi, Vishal-san,
> >
> > > The above message was printed as an error, but it is just an
> > > informational message. Change it to dbg().
> >
> > Hmmmmmmm.
> >
> > When I was a engineer for trouble-shooting of customer's Linux system,
> > the starting time and the ending time of any daemon was very helpful
> > for investigating their trouble.
> >
> > So, I think it is not only for developer, but also it is essential for
> > trouble-shooter for custmer support.
> > (It may be also same with system operator)
> >
> >
> > >
> > > Cc: QI Fuli <qi.fuli@jp.fujitsu.com>
> > > Cc: Dan Williams <dan.j.williams@intel.com>
> > > Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> > > ---
> > >  ndctl/monitor.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/ndctl/monitor.c b/ndctl/monitor.c index
> > > d29e378..b44f946 100644
> > > --- a/ndctl/monitor.c
> > > +++ b/ndctl/monitor.c
> > > @@ -660,7 +660,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)
> > >                       err((struct ndctl_ctx *)ctx, "daemon start failed\n");
> > >                       goto out;
> > >               }
> > > -             err((struct ndctl_ctx *)ctx, "ndctl monitor daemon started\n");
> > > +             dbg((struct ndctl_ctx *)ctx, "ndctl monitor daemon
> > > + started\n");
> >
> > Though I agree its message is not "error" certainly, I would like to
> > keep it as normal status level message.
> >
> 
> Sounds good to me.

In my original idea, I just wanted to log the "daemon started" message.
After thinking more about it, I agree that the message is not at "error" level.
However, considering this message will be helpful for some users like system operators,
how about changing this message level to "info" and meanwhile changing the default log level to "LOG_INFO" as following?

diff --git a/ndctl/monitor.c b/ndctl/monitor.c
index d29e378..10866b6 100644
--- a/ndctl/monitor.c
+++ b/ndctl/monitor.c
@@ -628,7 +628,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)
        if (monitor.verbose)
                ndctl_set_log_priority((struct ndctl_ctx *)ctx, LOG_DEBUG);
        else
-               ndctl_set_log_priority((struct ndctl_ctx *)ctx, LOG_NOTICE);
+               ndctl_set_log_priority((struct ndctl_ctx *)ctx, LOG_INFO);

        rc = read_config_file((struct ndctl_ctx *)ctx, &monitor, &param);
        if (rc)
@@ -657,7 +657,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)
                if (!monitor.log || strncmp(monitor.log, "./", 2) == 0)
                        ndctl_set_log_fn((struct ndctl_ctx *)ctx, log_syslog);
                if (daemon(0, 0) != 0) {
-                       err((struct ndctl_ctx *)ctx, "daemon start failed\n");
+                       info((struct ndctl_ctx *)ctx, "daemon start failed\n");
                        goto out;
                }
                err((struct ndctl_ctx *)ctx, "ndctl monitor daemon started\n");

Thank you very much,
QI Fuli
> _______________________________________________
> Linux-nvdimm mailing list
> Linux-nvdimm@lists.01.org
> https://lists.01.org/mailman/listinfo/linux-nvdimm
QI Fuli Oct. 5, 2018, 6:15 a.m. UTC | #5
> > > >
> > >
> > > Sounds good to me.
> >
> > In my original idea, I just wanted to log the "daemon started" message.
> > After thinking more about it, I agree that the message is not at "error" level.
> > However, considering this message will be helpful for some users like system
> operators,
> > how about changing this message level to "info" and meanwhile changing the
> default log level to "LOG_INFO" as following?
> >
> > diff --git a/ndctl/monitor.c b/ndctl/monitor.c
> > index d29e378..10866b6 100644
> > --- a/ndctl/monitor.c
> > +++ b/ndctl/monitor.c
> > @@ -628,7 +628,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)
> >         if (monitor.verbose)
> >                 ndctl_set_log_priority((struct ndctl_ctx *)ctx, LOG_DEBUG);
> >         else
> > -               ndctl_set_log_priority((struct ndctl_ctx *)ctx, LOG_NOTICE);
> > +               ndctl_set_log_priority((struct ndctl_ctx *)ctx, LOG_INFO);
> >
> >         rc = read_config_file((struct ndctl_ctx *)ctx, &monitor, &param);
> >         if (rc)
> > @@ -657,7 +657,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx)
> >                 if (!monitor.log || strncmp(monitor.log, "./", 2) == 0)
> >                         ndctl_set_log_fn((struct ndctl_ctx *)ctx, log_syslog);
> >                 if (daemon(0, 0) != 0) {
> > -                       err((struct ndctl_ctx *)ctx, "daemon start failed\n");
> > +                       info((struct ndctl_ctx *)ctx, "daemon start failed\n");
> >                         goto out;
> >                 }
> >                 err((struct ndctl_ctx *)ctx, "ndctl monitor daemon started\n");
> 
> Yes, this looks good to me. Will you send a proper patch for this, and I
> can replace my patch with yours.
> 
> Thanks,
> 	-Vishal
> 

Ok, I will send a patch.

> >
> > Thank you very much,
> > QI Fuli
> > > _______________________________________________
> > > Linux-nvdimm mailing list
> > > Linux-nvdimm@lists.01.org
> > > https://lists.01.org/mailman/listinfo/linux-nvdimm
> >
> >
diff mbox series

Patch

diff --git a/ndctl/monitor.c b/ndctl/monitor.c
index d29e378..b44f946 100644
--- a/ndctl/monitor.c
+++ b/ndctl/monitor.c
@@ -660,7 +660,7 @@  int cmd_monitor(int argc, const char **argv, void *ctx)
 			err((struct ndctl_ctx *)ctx, "daemon start failed\n");
 			goto out;
 		}
-		err((struct ndctl_ctx *)ctx, "ndctl monitor daemon started\n");
+		dbg((struct ndctl_ctx *)ctx, "ndctl monitor daemon started\n");
 	}
 
 	if (parse_monitor_event(&monitor, (struct ndctl_ctx *)ctx))