Finishing the neverending QOF flamewar

Chris Shoemaker c.shoemaker at cox.net
Mon Jan 30 17:57:23 EST 2006


On Mon, Jan 30, 2006 at 07:59:27PM +0000, Neil Williams wrote:
> > Not a single message of any type, anywhere, is 
> > logged with my patch that wasn't logged before, nor vice-versa. 
> 
> You have no evidence for such a statement. I attest that messages ARE logged 
> that should not be logged because of the change - or would have been if I'd 
> implemented it in QOF CVS.

?!? You are willing to believe that I would adamantly assert something
which I just made up?  ...???...

Then why didn't you just CHECK?  Don't you think it would have shut me up
to show what an idiot I was to have made such a claim so adamantly and
be wrong about it?  No one would be able to trust me.  Do you think I
would be so reckless with my reputation?

Proof:

  a) global_default_loglevel is initialized to zero.

  static QofLogLevel global_default_loglevel = 0;

  b) It is only ever changed in one place:

void qof_log_set_level_global(QofLogLevel level)
{
        gchar* level_string;

        if(!log_table || level == 0) { return; }
        global_default_loglevel = level;
        level_string = g_strdup(QofLogLevelasString(level));
        g_hash_table_foreach(log_table, log_module_foreach, level_string);
}

  c) That code path is never reached in any application other than GnuCash:

$ grep -sRI qof_log_set_level_global pilot-qof-0.0.7 gnotime-2.2.2 qof-gen
$
  d) The "else" statement is not reached when log_level==0.

gboolean qof_log_check(QofLogModule log_module, QofLogLevel log_level)
{
       log_string = NULL;
       if(!log_table || log_module == NULL || log_level == 0) { 
                return FALSE; }        
       log_string = (gchar*)g_hash_table_lookup(log_table, log_module);
       /* if log_module not found, use default. */
       if (log_string)
           maximum = QofLogLevelfromString(log_string);
       else
           maximum = global_default_loglevel;
        if(log_level <= maximum) { return TRUE; }
        return FALSE;
}
  e) When c) is TRUE and log_level > 0 and log_string == NULL then
this function returns TRUE iff log_level <= 0.  I.e. never.  Q.E.D.

Why on _earth_ would I make this stuff up?

-chris


More information about the gnucash-devel mailing list