26
26
* telepathy-glib has an internal mechanism for debug messages and filtering.
27
27
* Connection managers written with telepathy-glib are expected to connect
28
28
* this to their own debugging mechanisms: when the CM's debugging mechanism
29
* is activated, it should call tp_debug_set_flags_from_string(),
30
* tp_debug_set_flags_from_env() or tp_debug_set_all_flags().
29
* is activated, it should call tp_debug_set_flags() and/or
30
* tp_debug_set_persistent().
32
* The supported debug-mode keywords are subject to change, but currently
32
* The supported debug-mode keywords and the debug messages that they enable
33
* are subject to change, but currently include:
36
* <listitem><literal>manager</literal> - output debug messages regarding
37
* #TpConnectionManager (client)</listitem>
38
* <listitem><literal>connection</literal> - output debug messages regarding
39
* #TpBaseConnection (service) and #TpConnection (client)</listitem>
40
* <listitem><literal>channel</literal> - output debug messages regarding
41
* #TpChannel (client)</listitem>
42
* <listitem><literal>im</literal> - output debug messages regarding
43
* (text) instant messaging (service)</listitem>
44
* <listitem><literal>properties</literal> - output debug messages regarding
45
* #TpPropertiesMixin (service)</listitem>
46
* <listitem><literal>params</literal> - output debug messages regarding
47
* connection manager parameters (service)</listitem>
36
* <listitem><literal>manager</literal> -
37
* #TpConnectionManager (client)</listitem>
38
* <listitem><literal>connection</literal> - #TpBaseConnection (service)
39
* and #TpConnection (client)</listitem>
40
* <listitem><literal>contacts</literal> - #TpContact objects
42
* <listitem><literal>channel</literal> - #TpChannel (client)</listitem>
43
* <listitem><literal>im</literal> - (text) instant messaging
44
* (service)</listitem>
45
* <listitem><literal>properties</literal> -
46
* #TpPropertiesMixin (service)</listitem>
47
* <listitem><literal>params</literal> - connection manager parameters
48
* (service)</listitem>
49
* <listitem><literal>handles</literal> - handle reference tracking tracking
50
* in #TpBaseConnection (service) and #TpConnection (client)</listitem>
48
51
* <listitem><literal>all</literal> - all of the above</listitem>
98
104
{ "manager", TP_DEBUG_MANAGER },
99
105
{ "channel", TP_DEBUG_CHANNEL },
100
106
{ "proxy", TP_DEBUG_PROXY },
107
{ "handles", TP_DEBUG_HANDLES },
108
{ "contacts", TP_DEBUG_CONTACTS },
299
307
* stdout and stderr, and sending all messages that would have gone there
300
308
* to the given file instead.
310
* By default the file is truncated and hence overwritten each time the
311
* process is executed.
312
* Since version 0.7.14, if the filename is prefixed with '+' then the
313
* file is not truncated and output is added at the end of the file.
302
315
* Passing %NULL to this function is guaranteed to have no effect. This is
303
316
* so you can call it with the recommended usage
304
317
* <literal>tp_debug_divert_messages (g_getenv ("MYAPP_LOGFILE"))</literal>
317
330
if (filename == NULL)
320
fd = g_open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0644);
333
if (filename[0] == '+')
335
/* open in append mode */
336
fd = g_open (filename + 1, O_WRONLY | O_CREAT | O_APPEND, 0644);
340
/* open in trunc mode */
341
fd = g_open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0644);