gnc-trace module numbers

Neil Williams linux at
Tue Sep 27 09:41:33 EDT 2005

On Tuesday 27 September 2005 2:08 pm, Derek Atkins wrote:
> Neil Williams <linux at> writes:
> >                 gnc_set_logfile(f);
> Not done.  It uses the default

It'll need to be done with this change - the default was gnucash.trace and 
this change is to make the trace less gnucash-specific. The default filename 
is now qof.trace and each application should set their own filename.

> >                 gnc_set_log_level(MOD_BACKEND, GNC_LOG_DETAIL);
> >                 gnc_set_log_level(MOD_ENGINE, GNC_LOG_DETAIL);
> >                 gnc_set_log_level(MOD_IO, GNC_LOG_DETAIL);
> These are done in the enum-structure in gnc-trace.c and by the
> command-line through scheme.
> > I know it's not defined static like that and that gnucash can use command
> > line options to specify the modules and log detail, I'm hoping it's not
> > in the Scheme!
> Why?  Changing the scheme is /EASY/

I never like editing files I don't understand. 

How would I implement the filename change?

	FILE f*;
                f = fopen("/tmp/gnucash.trace", "w");


	if(f) { fclose(f); }
Also, I've created a qof_log_set_default() call that sets the extra 
log_modules that QOF now uses (it's not all engine).

The standard QOF log_modules are now:

or it's just as easy to call qof_log_set_default(gncLogLevel log_level);

There's also a foreach in case anyone needs it, and a count of the number of 
log_modules that have a non-zero log_level.

All are defined in <qof.h> (which is now fixed).

There is no limit to the number of log_modules - it should be possible to 
define log_module within a function and use a specific log_module for a set 
of functions and a different one in other functions. This is in case one 
source file contains code you want to log separately.

GNC_MOD_ENGINE could refer to the gnucash-specific engine code. We could also 
use GNC_MOD_OBJECT for the objects.

Note also that I've changed from 
static short module 
static gchar* log_module.

The use of a hashtable also means gnc_should_log can no longer be inlined as 
was the original plan in gnc-trace.c.


Neil Williams

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the gnucash-devel mailing list