[GNC-dev] gnc:debug changes

Mike Alexander mta at umich.edu
Sat Mar 7 00:24:03 EST 2020


I spent some time yesterday figuring out why gnc:debug never produced 
any output regardless of the gnc.scm log level.  I tracked it down to 
commits 42b6fb9 and b3a4cd6 from last July.  The actual bug is trivial 
(they test for the log level for "gnc" instead of "gnc.scm") but I 
wonder if b3a4cd6 is a good idea.  It has the effect of binding the 
gnc.scm log level on the first call to gnc:debug and ignoring subsequent 
changes to it.  This means that later calls to (qof-log-set-level 
"gnc.scm" ...) will have no effect.  It is sometimes useful to turn on 
and off Scheme debugging around sections of code you care about.

The optimization from b3a4cd6 seems to be relatively minor.  The 
arguments to gnc:debug are evaluated when debugging is off even with 
this change (something I verified) and the call to strify is avoided 
even without it.  All you're really avoiding is the actual call to 
gnc:debug and the call to qof-log-check.  I propose reverting back to 
42b6fb9 with the bugs in it fixed.  Is this ok? If so I'll push a 
change.

         Mike


More information about the gnucash-devel mailing list