telepathy-glib has an internal mechanism for debug messages and filtering.
Connection managers written with telepathy-glib are expected to connect
this to their own debugging mechanisms: when the CM's debugging mechanism
is activated, it should call
The supported debug-mode keywords and the debug messages that they enable are subject to change, but currently include:
misc- low-level utility code
manager- TpConnectionManager (client)
connection- TpBaseConnection (service) and TpConnection (client)
contacts- TpContact objects (client)
channel- TpChannel (client)
im- (text) instant messaging (service)
properties- TpDBusPropertiesMixin and TpPropertiesMixin (service)
params- connection manager parameters (service)
handles- handle reference tracking tracking in TpBaseConnection (service) and TpConnection (client)
accounts- the TpAccountManager and TpAccount objects (client)
contact-lists- the TpBaseContactList (service)
debugger- TpDebugClient objects
tls- TpTLSCertificate objects (client)
all- all of the above
void tp_debug_set_flags (
const gchar *flags_string);
Set the debug flags indicated by
, in addition to any already
The parsing matches that of
If telepathy-glib was compiled with --disable-debug (not recommended), this function has no practical effect, since the debug messages it would enable were removed at compile time.
The flags to set, comma-separated. If
void tp_debug_set_persistent (
Used to enable persistent operation of the connection manager process for debugging purposes.
void tp_debug_divert_messages (
const gchar *filename);
Open the given file for writing and duplicate its file descriptor to be used for stdout and stderr. This has the effect of closing the previous stdout and stderr, and sending all messages that would have gone there to the given file instead.
By default the file is truncated and hence overwritten each time the process is executed. Since version 0.7.14, if the filename is prefixed with '+' then the file is not truncated and output is added at the end of the file.
NULL to this function is guaranteed to have no effect. This is
so you can call it with the recommended usage
tp_debug_divert_messages (g_getenv ("MYAPP_LOGFILE"))
and it won't do anything if the environment variable is not set.
This function still works if telepathy-glib was compiled without debug support.
A file to which to divert stdout and stderr, or
void tp_debug_timestamped_log_handler (
const gchar *log_domain,
const gchar *message,
A GLogFunc that prepends the UTC time (currently in ISO 8601 format, with microsecond resolution) to the message, then calls g_log_default_handler.
Intended usage is:
if (g_getenv ("MYPROG_TIMING") != NULL) g_log_set_default_handler (tp_debug_timestamped_log_handler, NULL);
If telepathy-glib was compiled with --disable-debug (not recommended),
this function is equivalent to
Changed in 0.9.0: timestamps are now printed in UTC, in RFC-3339 format. Previously, they were printed in local time, in a format similar to RFC-3339.
the message's log domain
the log level of the message
the message to process