logging overhaul (please read)

Josh Sled jsled at asynchronous.org
Fri Feb 9 16:53:20 EST 2007


On Fri, 2007-02-09 at 13:41 -0500, Josh Sled wrote:
> On Fri, 2007-02-09 at 13:10 -0500, Derek Atkins wrote:
> > Quoting Josh Sled <jsled at asynchronous.org>:
> > 
> > [snip]
> > > The space-based indentation as per ENTER/LEAVE has been disabled.
> > > Before, the {in,de}dent calls were conditional on qof_log_check, but
> > > that no longer exists.  I'm pretty sure it can fit back in by creating
> > > two new log levels... but I'd like to hear feedback first?  I personally
> > > don't find it useful, but I think others do, and it's a pretty big
> > > regression.
> > 
> > I personally like this functionality and would miss it if it's gone
> > for good.  It's EXTREMELY useful when you're trying to trace the
> > program to see when you get out of a particular call tree by
> > looking at the indentation level.  It's most helpful when you have
> > a re-entrant function.
> 
> *nod* I'll work to restore this functionality.

This is back (r15539).

As penance for breaking it in the first place, I started to go through
the sources ensuring the balance on ENTER/LEAVE pairs.  One of the
problem is that mismatched pairs end up leaving the current indent
counter floating at some absurdly high value; on a run just now, the
last log statement has 904 spaces (226 indents). :/

But after going through a fraction of the uses, I decided to stop.
Generally doing this stuff in a language without structured exception
handling is hard, but in particular, the g_return{,_val}_if_fail
construct makes it a bit more painful.

To that end, I've added gnc_leave_return{,_val}_if_fail macros to
qoflog.h, and even used them in a few places, but they're not ideal ...
you can't set the message of the LEAVE, for example.

In any case, someone should still go through and audit the balance of
ENTER/LEAVE statements. At worst because it's the Right Thing to do, but
also because mis-matched pairs can (pretty early on) render the
indentation level confusing or maybe misleading ... :/

Also, I removed the TRACE and DETAIL levels, the DEBUGCMD macro, and
some other unused stuff.

-- 
...jsled
http://asynchronous.org/ - a=jsled;b=asynchronous.org;echo ${a}@${b}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20070209/0eb709df/attachment-0001.bin 


More information about the gnucash-devel mailing list