[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Cluster-devel] logsys in fenced

On Wed, Jun 25, 2008 at 03:53:58PM +0100, Christine Caulfield wrote:
> >. Leave log_debug() unchanged, and leave the meaning/effect of -D 
> >unchanged.
> >  syslog/logsys are about logging to files.  The debug "logging" I use is
> >  about logging to either an in-memory buffer or to stderr; syslog/logsys
> >  are not relevant to that.
> But isn't the point of logsys to centralise all our logging so the user 
> can say whether it goes to stderr, a file or syslog. and that it all 
> uses the same code so it's easy to tell users how to redirect it as they 
> want.

To a file or syslog yes.  Re stderr, I don't think you understand how the
stderr output is used.  When you run "fenced -D", the daemon is run in the
foreground and all debug output goes to stderr.  foreground and
debug-to-stderr always go together, and it's always an inherently manual
process, always done explicitly from the command line, always done on the
individual programs you want to observe.  This is the *manual debugging
process* we're talking about here.

> >. Change log_error() to use logsys instead of syslog, i.e. don't change
> >  the existing log_error() call sites.
> >
> >  #define log_error(fmt, args...) \
> >  do { \
> >	log_debug(fmt, ##args); \
> >  -	syslog(LOG_ERR, fmt, ##args); \
> >  + 	log_printf(LOG_ERR, fmt, ##args); \
> >  } while (0)
> So then we have a do {} while macro whose only purpose is to simply 
> change the name of a function call. Now THAT's surely ugly and pointless.

No, I count four separate things the log_error macro does (including the
name change).

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]