[Telepathy] Gabble debugging code

Dafydd Harries dafydd.harries at collabora.co.uk
Thu Jul 27 09:16:15 PDT 2006


Gabble has some new support code for debug messages.

 * The --disable-debug configure script flag disables most debug messages.
   (There's still some code that calls g_debug directly.)

 * The GABBLE_DEBUG environment variable controls which debug messages are
   printed. E.g.

   $ GABBLE_DEBUG=presence:groups:roster ./src/telepathy-gabble

   See debug.h for the full list of available flags.

 * GABBLE_DEBUG=all enables all debug messages.

 * GABBLE_PERSIST is deprecated in favour of the "persist" debug flag.

 * If you want to print debug messages:

   - Define DEBUG_FLAG to the appropriate flag at the beginning of the file.

   - #include "debug.h"

   - Use the printf-like DEBUG () macro to print messages.

   - Use if (DEBUGGING) { ... } to wrap non-trivial debug code.

   - Use #ifdef ENABLE_DEBUG to wrap file-level chunks of debug-related code.

Note that DEBUG () automatically prefixes the debug message with the name of
the calling function, so you shouldn't include G_STRFUNC/__FUNCTION__ in the
debug message.

-- 
Dafydd


More information about the Telepathy mailing list