Re: [Evolution] Debug enhancements for evo



On Wed, 2007-09-05 at 15:03 -0400, Paul Smith wrote:
It seems that Evo is using a standard library (glib maybe?) to provide
debug/logging facilities.  Is there any way to either resolve these
issues in Evo itself, or else get them resolved by whomever manages the
libraries?

I don't have an answer to your immediate question but I have thought
about Evolution's debug/logging facilities a bit.

A lot of good debugging information is disabled in the released tarballs
using this technique:

   #define d(x)

   ...

   d(printf ("Useful debugging info..."));

A developer or interested hacker then has to redefine "d" as

   #define d(x) x

and recompile to unlock those debug messages.

The problem with this is there's no central logging mechanism that all
the messages flow through, so adding a timestamp as you suggested (and
an excellent suggestion it is) would require changing all the messages
individually.

Instead, we should better utilize GLib's logging features.  For
starters, change all debug messages over to

   g_debug ("Useful debugging info...");

and give each Makefile.am a unique G_LOG_DOMAIN.

Then register a handler function for all DEBUG-level messages.
Depending on whether a DEBUG message's log domain is turned on or off
(off by default), the handler function could time-stamp and print the
message or silently eat it, respectively.

Log domains could be turned on perhaps by way of an environment variable
(and/or make the --debug option actually do something useful):

   EVO_DEBUG=colon:separated:list:of:logging:domains

There's a lot we could do here.  These are just a few ideas.  Something
to shoot for in Evolution 2.14, perhaps?

Further discussion should be moved to evolution-hackers.

Matthew Barnes




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]