QofLogModule definitions

Neil Williams linux at codehelp.co.uk
Sat Oct 1 17:19:54 EDT 2005


On Saturday 01 October 2005 9:54 pm, Neil Williams wrote:
> Personally, I think GNC_MOD_GUI is too wide and although it may be useful
> as a catch-all (which is why I put it in gnc-engine.h), there's no reason
> not to have GNC_MOD_TREE GNC_MOD_VIEW GNC_MOD_ whatever. There is also
> absolutely no reason to have those in any one file - put them wherever you
> like, according to the files that will be using them.
>
> Give them a gnucash- prefix in the actual text:
>
> #define GNC_MOD_TREE "gnucash-gui-tree"
>
> and all will be well. It is important that each log_module is a unique
> string and the simplest way to ensure that is to prefix it with the
> application name.

e.g. Why not mirror the Doxygen groups in QofLogModules? That should be 
relatively easy because Doxygen also relies on tags that encompass the entire 
file contents.

You don't need to even use a define if your QofLogModule is truly specific to 
one file - declare it, set a log_level for it and use it all in the one C 
file. #include "qof.h" does everything else for you.

That's something I will probably do in CashUtil (which has a --debug command 
that will be expanded to allow tweaking of specific QofLogModules, possibly 
via a config file). The QOF log_modules will also probably be expanded - this 
patch already adds several new ones. Again, the "core" of default QOF 
log_modules are exposed via the qof.h API so applications can tweak the 
log_level for those but there will be some internal log_modules that will be 
set to FATAL or WARNING only and used for debugging within QOF itself. 
GnuCash can do the same. Flexibility and choice is the name of the game.

-- 

Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20051001/968876de/attachment.bin


More information about the gnucash-devel mailing list