8
8
<link rel="up" href="ch-utilities.html" title="Utilities">
9
9
<link rel="prev" href="telepathy-glib-debug.html" title="Common debug support">
10
10
<link rel="next" href="telepathy-glib-TpIntSet.html" title="TpIntSet">
11
<meta name="generator" content="GTK-Doc V1.13 (XML mode)">
11
<meta name="generator" content="GTK-Doc V1.14 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
<link rel="chapter" href="ch-dbus.html" title="General D-Bus support">
14
<link rel="chapter" href="ch-protocol.html" title="The Telepathy protocol">
15
<link rel="chapter" href="ch-client.html" title="Client-side proxies">
16
<link rel="chapter" href="ch-service-dbus.html" title="Service-side D-Bus interfaces">
17
<link rel="chapter" href="ch-service-base.html" title="Service-side implementation">
18
<link rel="chapter" href="ch-service-handles.html" title="Service-side handle repositories">
19
<link rel="chapter" href="ch-utilities.html" title="Utilities">
21
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
22
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
54
47
#include <telepathy-glib/debug-sender.h>
56
49
<a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender-struct" title="TpDebugSender">TpDebugSender</a>;
57
<a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender"><span class="returnvalue">TpDebugSender</span></a> * <a class="link" href="telepathy-glib-debug-sender.html#tp-debug-sender-dup" title="tp_debug_sender_dup ()">tp_debug_sender_dup</a> (void);
58
<span class="returnvalue">void</span> <a class="link" href="telepathy-glib-debug-sender.html#tp-debug-sender-add-message" title="tp_debug_sender_add_message ()">tp_debug_sender_add_message</a> (<a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender"><span class="returnvalue">TpDebugSender</span></a> *self,
59
<a href="http://library.gnome.org/devel/glib/unstable/glib-Date-and-Time-Functions.html#GTimeVal"><span class="returnvalue">GTimeVal</span></a> *timestamp,
60
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *domain,
61
<a href="http://library.gnome.org/devel/glib/unstable/glib-Message-Logging.html#GLogLevelFlags"><span class="returnvalue">GLogLevelFlags</span></a> level,
62
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *string);
63
<span class="returnvalue">void</span> <a class="link" href="telepathy-glib-debug-sender.html#tp-debug-sender-log-handler" title="tp_debug_sender_log_handler ()">tp_debug_sender_log_handler</a> (const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *log_domain,
64
<a href="http://library.gnome.org/devel/glib/unstable/glib-Message-Logging.html#GLogLevelFlags"><span class="returnvalue">GLogLevelFlags</span></a> log_level,
65
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *message,
66
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> exclude);
50
<a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender"><span class="returnvalue">TpDebugSender</span></a> * <a class="link" href="telepathy-glib-debug-sender.html#tp-debug-sender-dup" title="tp_debug_sender_dup ()">tp_debug_sender_dup</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
51
<span class="returnvalue">void</span> <a class="link" href="telepathy-glib-debug-sender.html#tp-debug-sender-add-message" title="tp_debug_sender_add_message ()">tp_debug_sender_add_message</a> (<em class="parameter"><code><a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender"><span class="type">TpDebugSender</span></a> *self</code></em>,
52
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Date-and-Time-Functions.html#GTimeVal"><span class="type">GTimeVal</span></a> *timestamp</code></em>,
53
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *domain</code></em>,
54
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Message-Logging.html#GLogLevelFlags"><span class="type">GLogLevelFlags</span></a> level</code></em>,
55
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>);
56
<span class="returnvalue">void</span> <a class="link" href="telepathy-glib-debug-sender.html#tp-debug-sender-log-handler" title="tp_debug_sender_log_handler ()">tp_debug_sender_log_handler</a> (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *log_domain</code></em>,
57
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Message-Logging.html#GLogLevelFlags"><span class="type">GLogLevelFlags</span></a> log_level</code></em>,
58
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *message</code></em>,
59
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> exclude</code></em>);
69
62
<div class="refsect1" title="Object Hierarchy">
70
63
<a name="telepathy-glib-debug-sender.object-hierarchy"></a><h2>Object Hierarchy</h2>
71
64
<pre class="synopsis">
72
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
65
<a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
82
75
<div class="refsect1" title="Properties">
83
76
<a name="telepathy-glib-debug-sender.properties"></a><h2>Properties</h2>
84
77
<pre class="synopsis">
85
"<a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender--enabled" title='The "enabled" property'>enabled</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write
78
"<a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender--enabled" title='The "enabled" property'>enabled</a>" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write
88
81
<div class="refsect1" title="Description">
103
96
In a Connection Manager, one would probably keep a ref to the <a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender"><span class="type">TpDebugSender</span></a>
104
97
in the connection manager object, and when this said object is finalized, so
105
98
is the process's <a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender"><span class="type">TpDebugSender</span></a>. A GLib log handler is also provided:
106
<a class="link" href="telepathy-glib-debug-sender.html#tp-debug-sender-log-handler" title="tp_debug_sender_log_handler ()"><code class="function">tp_debug_sender_log_handler()</code></a>.</p>
99
<a class="link" href="telepathy-glib-debug-sender.html#tp-debug-sender-log-handler" title="tp_debug_sender_log_handler ()"><code class="function">tp_debug_sender_log_handler()</code></a>.
108
102
<div class="refsect1" title="Details">
109
103
<a name="telepathy-glib-debug-sender.details"></a><h2>Details</h2>
111
105
<a name="TpDebugSender-struct"></a><h3>TpDebugSender</h3>
112
106
<pre class="programlisting">typedef struct _TpDebugSender TpDebugSender;</pre>
114
An object for exposing the Telepathy debug interface.</p>
115
<div class="variablelist"><table border="0">
116
<col align="left" valign="top">
108
An object for exposing the Telepathy debug interface.
119
110
<p class="since">Since 0.7.36</p>
122
113
<div class="refsect2" title="tp_debug_sender_dup ()">
123
114
<a name="tp-debug-sender-dup"></a><h3>tp_debug_sender_dup ()</h3>
124
<pre class="programlisting"><a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender"><span class="returnvalue">TpDebugSender</span></a> * tp_debug_sender_dup (void);</pre>
115
<pre class="programlisting"><a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender"><span class="returnvalue">TpDebugSender</span></a> * tp_debug_sender_dup (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
126
117
Returns a <a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender"><span class="type">TpDebugSender</span></a> instance on the bus this process was activated by
127
118
(if it was launched by D-Bus service activation), or the session bus
147
139
<div class="refsect2" title="tp_debug_sender_add_message ()">
148
140
<a name="tp-debug-sender-add-message"></a><h3>tp_debug_sender_add_message ()</h3>
149
<pre class="programlisting"><span class="returnvalue">void</span> tp_debug_sender_add_message (<a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender"><span class="returnvalue">TpDebugSender</span></a> *self,
150
<a href="http://library.gnome.org/devel/glib/unstable/glib-Date-and-Time-Functions.html#GTimeVal"><span class="returnvalue">GTimeVal</span></a> *timestamp,
151
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *domain,
152
<a href="http://library.gnome.org/devel/glib/unstable/glib-Message-Logging.html#GLogLevelFlags"><span class="returnvalue">GLogLevelFlags</span></a> level,
153
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *string);</pre>
141
<pre class="programlisting"><span class="returnvalue">void</span> tp_debug_sender_add_message (<em class="parameter"><code><a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender"><span class="type">TpDebugSender</span></a> *self</code></em>,
142
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Date-and-Time-Functions.html#GTimeVal"><span class="type">GTimeVal</span></a> *timestamp</code></em>,
143
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *domain</code></em>,
144
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Message-Logging.html#GLogLevelFlags"><span class="type">GLogLevelFlags</span></a> level</code></em>,
145
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>);</pre>
155
147
Adds a new message to the debug sender message queue. If the
156
<a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender--enabled" title='The "enabled" property'><span class="type">"enabled"</span></a> property is set to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, then a NewDebugMessage
157
signal will be fired too.</p>
148
<a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender--enabled" title='The "enabled" property'><span class="type">"enabled"</span></a> property is set to <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, then a NewDebugMessage
149
signal will be fired too.
158
151
<div class="variablelist"><table border="0">
159
152
<col align="left" valign="top">
162
155
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
163
<td> A <a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender"><span class="type">TpDebugSender</span></a> instance
156
<td>A <a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender"><span class="type">TpDebugSender</span></a> instance
167
160
<td><p><span class="term"><em class="parameter"><code>timestamp</code></em> :</span></p></td>
168
<td> Time of the message
161
<td>Time of the message
172
165
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
177
170
<td><p><span class="term"><em class="parameter"><code>level</code></em> :</span></p></td>
178
<td> The message level
171
<td>The message level
182
175
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
183
<td> The message string itself
176
<td>The message string itself
191
184
<div class="refsect2" title="tp_debug_sender_log_handler ()">
192
185
<a name="tp-debug-sender-log-handler"></a><h3>tp_debug_sender_log_handler ()</h3>
193
<pre class="programlisting"><span class="returnvalue">void</span> tp_debug_sender_log_handler (const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *log_domain,
194
<a href="http://library.gnome.org/devel/glib/unstable/glib-Message-Logging.html#GLogLevelFlags"><span class="returnvalue">GLogLevelFlags</span></a> log_level,
195
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *message,
196
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> exclude);</pre>
186
<pre class="programlisting"><span class="returnvalue">void</span> tp_debug_sender_log_handler (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *log_domain</code></em>,
187
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Message-Logging.html#GLogLevelFlags"><span class="type">GLogLevelFlags</span></a> log_level</code></em>,
188
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *message</code></em>,
189
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> exclude</code></em>);</pre>
198
191
A generic log handler designed to be used by CMs. It initially calls
199
<a href="http://library.gnome.org/devel/glib/unstable/glib-Message-Logging.html#g-log-default-handler"><code class="function">g_log_default_handler()</code></a>, and then sends the message on the bus
192
<a href="/usr/share/gtk-doc/html/glib/glib-Message-Logging.html#g-log-default-handler"><code class="function">g_log_default_handler()</code></a>, and then sends the message on the bus
200
193
<a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender"><span class="type">TpDebugSender</span></a>.
203
196
The <em class="parameter"><code>exclude</code></em> parameter is designed to allow filtering one domain, instead of
204
197
sending every message to the <a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender"><span class="type">TpDebugSender</span></a>: typical usage is for a
205
process to filter out messages from its own <a href="http://library.gnome.org/devel/glib/unstable/glib-Message-Logging.html#G-LOG-DOMAIN:CAPS"><code class="literal">G_LOG_DOMAIN</code></a>, so that it can
198
process to filter out messages from its own <a href="/usr/share/gtk-doc/html/glib/glib-Message-Logging.html#G-LOG-DOMAIN:CAPS"><code class="literal">G_LOG_DOMAIN</code></a>, so that it can
206
199
append a category to its own messages and pass them directly to
207
200
tp_debug_sender_add_message. Note that every message, regardless of
208
domain, is given to <a href="http://library.gnome.org/devel/glib/unstable/glib-Message-Logging.html#g-log-default-handler"><code class="function">g_log_default_handler()</code></a>.
201
domain, is given to <a href="/usr/share/gtk-doc/html/glib/glib-Message-Logging.html#g-log-default-handler"><code class="function">g_log_default_handler()</code></a>.
211
204
Note that a ref to a <a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender"><span class="type">TpDebugSender</span></a> must be kept at all times otherwise
236
229
<td class="listing_code"><pre class="programlisting"><span class="comment">/* Create a main loop and debug sender */</span>
237
GMainLoop <span class="symbol">*</span>loop <span class="symbol">=</span> <span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-main-loop-new">g_main_loop_new</a></span> <span class="symbol">(</span>NULL<span class="symbol">,</span> FALSE<span class="symbol">);</span>
230
GMainLoop <span class="symbol">*</span>loop <span class="symbol">=</span> <span class="function"><a href="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#g-main-loop-new">g_main_loop_new</a></span> <span class="symbol">(</span>NULL<span class="symbol">,</span> FALSE<span class="symbol">);</span>
238
231
TpDebugSender <span class="symbol">*</span>sender <span class="symbol">=</span> <span class="function"><a href="telepathy-glib-debug-sender.html#tp-debug-sender-dup">tp_debug_sender_dup</a></span> <span class="symbol">();</span>
240
233
<span class="comment">/* Set the default handler */</span>
241
<span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Message-Logging.html#g-log-set-default-handler">g_log_set_default_handler</a></span> <span class="symbol">(</span>tp_debug_sender_log_handler<span class="symbol">,</span> G_LOG_DOMAIN<span class="symbol">);</span>
234
<span class="function"><a href="/usr/share/gtk-doc/html/glib/glib-Message-Logging.html#g-log-set-default-handler">g_log_set_default_handler</a></span> <span class="symbol">(</span>tp_debug_sender_log_handler<span class="symbol">,</span> G_LOG_DOMAIN<span class="symbol">);</span>
243
236
<span class="comment">/* Run the main loop, but keeping a ref on the TpDebugSender from</span>
244
237
<span class="comment"> * the beginning of this code sample. */</span>
245
<span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-main-loop-run">g_main_loop_run</a></span> <span class="symbol">(</span>loop<span class="symbol">);</span>
238
<span class="function"><a href="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#g-main-loop-run">g_main_loop_run</a></span> <span class="symbol">(</span>loop<span class="symbol">);</span>
247
240
<span class="comment">/* g_main_loop_quit was called, so only now can we clean up the</span>
248
241
<span class="comment"> * TpDebugSender. */</span>
249
<span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span> <span class="symbol">(</span>sender<span class="symbol">);</span></pre></td>
242
<span class="function"><a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span> <span class="symbol">(</span>sender<span class="symbol">);</span></pre></td>
258
(In a connection manager, replace <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#g-main-loop-run"><code class="function">g_main_loop_run()</code></a> in the above example
251
(In a connection manager, replace <a href="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#g-main-loop-run"><code class="function">g_main_loop_run()</code></a> in the above example
259
252
with <a class="link" href="telepathy-glib-run.html#tp-run-connection-manager" title="tp_run_connection_manager ()"><code class="function">tp_run_connection_manager()</code></a>.)
262
255
This function is merely for convenience if it meets the requirements.
263
256
It can easily be re-implemented in services, and does not need to be
265
259
<div class="variablelist"><table border="0">
266
260
<col align="left" valign="top">
269
263
<td><p><span class="term"><em class="parameter"><code>log_domain</code></em> :</span></p></td>
270
<td> domain of the message
264
<td>domain of the message
274
268
<td><p><span class="term"><em class="parameter"><code>log_level</code></em> :</span></p></td>
275
<td> log leve of the message
269
<td>log leve of the message
279
273
<td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
280
<td> the message itself
274
<td>the message itself
284
278
<td><p><span class="term"><em class="parameter"><code>exclude</code></em> :</span></p></td>
285
<td> a log domain string to exclude from the <a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender"><span class="type">TpDebugSender</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
279
<td>a log domain string to exclude from the <a class="link" href="telepathy-glib-debug-sender.html#TpDebugSender"><span class="type">TpDebugSender</span></a>, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
294
288
<a name="telepathy-glib-debug-sender.property-details"></a><h2>Property Details</h2>
295
289
<div class="refsect2" title='The "enabled" property'>
296
290
<a name="TpDebugSender--enabled"></a><h3>The <code class="literal">"enabled"</code> property</h3>
297
<pre class="programlisting"> "enabled" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write</pre>
291
<pre class="programlisting"> "enabled" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write</pre>
299
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the NewDebugMessage signal should be emitted when a new debug
300
message is generated.</p>
293
<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the NewDebugMessage signal should be emitted when a new debug
294
message is generated.
301
296
<p>Default value: FALSE</p>
305
300
<div class="footer">
307
Generated by GTK-Doc V1.13</div>
302
Generated by GTK-Doc V1.14</div>
b'\\ No newline at end of file'