[PATCH 06/10] nvme-cli: add generic logging functionality

Martin Wilck mwilck at suse.com
Tue Mar 16 08:14:30 GMT 2021


On Mon, 2021-03-15 at 10:45 -0700, Sagi Grimberg wrote:
> 
> > From: Martin Wilck <mwilck at suse.com>
> > 
> > Add a msg() macro that allows more flexible customization of
> > logging
> > both at build time and at run time. Allow several log levels, using
> > the well-known standard sylog levels. Also optionally allow
> > printing
> > of log timestamps.
> > 
> > Put '#define LOG_FUNCNAME' before '#include "util/log.h"' to enable
> > printing
> > the name of the calling function before the log message.
> > 
> > Use this functionality in the fabrics code for now, wherever
> > fprintf(stderr, ...)
> > had been used.
> > 
> > No functional change except changing the output channel of 554db7d
> > ("print
> > device name when creating a persistent device") from stdout to
> > stderr.
> > 
> > Signed-off-by: Martin Wilck <mwilck at suse.com>
> > ---
> >   Makefile   |  2 +-
> >   fabrics.c  | 85 ++++++++++++++++++++++++++++---------------------
> > --
> >   util/log.c | 90
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >   util/log.h | 34 +++++++++++++++++++++
> 
> I think it makes sense to do a wider sweep also for nvme.c and
> friends
> no?

Yes, but could we do that wider sweep separately, or do you consider it
a requirement?

Regards,
Martin









More information about the Linux-nvme mailing list