[neomutt-devel] Quick Vote: Debugging Aids

Pietro Cerutti gahr at gahr.ch
Fri Sep 1 11:35:36 CEST 2017


On Sep  1 17 09:12, Thomas Adam wrote:
> On Tue, Aug 29, 2017 at 12:05:45PM +0100, Richard Russon wrote:
> > Hi guys,
> > 
> > I've a couple of things for quick discussion...
> > If they're liked, we can discuss them more fully in an issue.
> > 
> > ---
> > * Turn mutt_debug() into a macro.
> > 
> > Change the proto (abbrev) from:
> >     void mutt_debug(level, fmt, ...);
> > to
> >     void _mutt_debug(file, line, func, level, fmt, ...);
> > 
> > add macro
> >     #define mutt_debug(l,f,...) _mutt_debug(__FILE__, __LINE__, __func__, l, f, ...)
> > 
> > then I'd suggest:
> >     debug level 1,2: brief log messages (as normal)
> >     debug level >2:  full details for every line
> > 
> > This could be an 'easy' task
> > 
> > VOTE: mutt_debug() macro
> >     * Yes
> >     * No
> 
> No.  I have never found logging levels to be useful at all.  If you've turned
> the use of mutt_debug() on, then you get everything, or nothing.  With
> different log levels, it's up to both the programmer, and the person using it,
> to know which log-level is best.

mh.. I think this is a fair point. Especially since we're not in a
performance-critical application. If we're to log, then we better log
complete info.

I'd be in favour of dropping logging levels too, but I'd keep the macro
approach that'd give us __FILE__, __LINE__, and __func__.

-- 
Pietro Cerutti
gahr at gahr.ch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 890 bytes
Desc: not available
URL: <http://mailman.neomutt.org/pipermail/neomutt-devel-neomutt.org/attachments/20170901/596a5c5d/attachment.sig>


More information about the neomutt-devel mailing list