logging overhaul (please read)

Josh Sled jsled at asynchronous.org
Fri Feb 9 13:41:43 EST 2007


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.


> I think I like the log-level test short->long, because it means
> if I set e.g. "gnc" -> debug then I get ALL "gnc.*" messages,
> even if gnc.foo.bar is set to "error"..

In both approaches, un-specified levels inherit from the longest
sub-match, but the longest match is always used.  In the example you
gave, (gnc.foo.bar,info) would not be logged, but (gnc.notfoo,info)
would be.

This can be very useful to run the overall system at (say) "info", but
to quiet down a particularly uninteresting/stable/noisy subsystem (e.g.
our xml layer) ... and conversely to get more detail from a problematic
layer (e.g., "gnc.gui.plugin-page.sx-list").


Going long->short is only to get slightly better performance:
"gnc.notfoo" would still match at "debug" (with 3 lookups: "gnc.notfoo",
"gnc", "") while "gnc.foo.bar" would match at "error" in 1 lookup
(instead of 4).

(But now that I think about it, you only get better performance in the
relatively uncommon case of having a lot of highly-specific overrides.
I probably won't make that change.)

-- 
...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/aa76217b/attachment.bin 


More information about the gnucash-devel mailing list