gnc-trace module numbers
linux at codehelp.co.uk
Sun Sep 25 13:51:26 EDT 2005
I'm looking again at gnc-trace because I want to make it less GnuCash
I feel we need to let any QOF application create their own traces with their
own list of modules and not force MOD_GUI, MOD_LOT, MOD_ACCOUNT,
MOD_SX and others onto other applications.
In cashutil, I've been using:
f = fopen("/tmp/cashutil.trace", "w");
I also want a MOD_CLI, MOD_SHELL, MOD_PILOT and a few others, without
having these hard-coded into QOF or lumped into G2.
So how to extend gncModuleType?
Make gnc_log_modules (which is probably best as just a default) into a setup
call for a GHashTable and dump gncModuleType altogether?
gnc_set_log_level would be a g_hash_table_insert internally,
gnc_set_log_level_global would use a g_hash_table_foreach internally,
gnc_should_log would be a g_hash_table_lookup.
Then each application could call gnc_set_log_level to set up it's defaults.
In effect, the above snippet from CashUtil would be all that is needed to
handle the debug output. (I'll extend CashUtil later to accept different
Just an idea so far.
If gnc_log_modules is also dumped, gnc_set_log_level would simply check for
the hash table and create it if it wasn't found before the first insert.
That's my preference at the moment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20050925/a7f36c06/attachment.bin
More information about the gnucash-devel