libpurple/debug.h

changeset 40950
c3fc77a3c015
parent 40874
0cf92aa817fd
child 41120
02abf3170610
equal deleted inserted replaced
40949:1472618b493d 40950:c3fc77a3c015
38 #include <glib-object.h> 38 #include <glib-object.h>
39 39
40 #include <stdarg.h> 40 #include <stdarg.h>
41 41
42 G_BEGIN_DECLS 42 G_BEGIN_DECLS
43
44 /**
45 * PURPLE_TYPE_DEBUG_UI:
46 *
47 * The standard _get_type macro for #PurpleDebugUi.
48 */
49 #define PURPLE_TYPE_DEBUG_UI (purple_debug_ui_get_type())
50 G_DECLARE_INTERFACE(PurpleDebugUi, purple_debug_ui, PURPLE, DEBUG_UI, GObject)
51 43
52 /** 44 /**
53 * PurpleDebugLevel: 45 * PurpleDebugLevel:
54 * @PURPLE_DEBUG_ALL: All debug levels. 46 * @PURPLE_DEBUG_ALL: All debug levels.
55 * @PURPLE_DEBUG_MISC: General chatter. 47 * @PURPLE_DEBUG_MISC: General chatter.
68 PURPLE_DEBUG_ERROR, 60 PURPLE_DEBUG_ERROR,
69 PURPLE_DEBUG_FATAL 61 PURPLE_DEBUG_FATAL
70 62
71 } PurpleDebugLevel; 63 } PurpleDebugLevel;
72 64
73 /** 65 #include "purpledebugui.h"
74 * PurpleDebugUiInterface:
75 * @print: Called to output a debug string to the UI.
76 * @is_enabled: Returns if debug printing is enabled in the UI for a @level and
77 * @category.
78 *
79 * Debug UI operations.
80 */
81 struct _PurpleDebugUiInterface {
82 /*< private >*/
83 GTypeInterface parent_iface;
84
85 /*< public >*/
86 void (*print)(PurpleDebugUi *ui, PurpleDebugLevel level, const gchar *category, const gchar *arg_s);
87 gboolean (*is_enabled)(PurpleDebugUi *ui, PurpleDebugLevel level, const gchar *category);
88
89 /*< private >*/
90 gpointer reserved[4];
91 };
92 66
93 /** 67 /**
94 * purple_debug: 68 * purple_debug:
95 * @level: The debug level. 69 * @level: The debug level.
96 * @category: The category (or %NULL). 70 * @category: The category (or %NULL).
267 * 241 *
268 * Since: 3.0.0 242 * Since: 3.0.0
269 */ 243 */
270 PurpleDebugUi *purple_debug_get_ui(void); 244 PurpleDebugUi *purple_debug_get_ui(void);
271 245
272 /**
273 * purple_debug_ui_is_enabled:
274 * @ui: The #PurpleDebugUi instance.
275 * @level: The #PurpleLogLevel.
276 * @category: An optional category.
277 *
278 * Checks if the ui should output messages at the given level and optional
279 * category.
280 *
281 * Typically this function will not need to be called outside of libpurple.
282 *
283 * Returns: %TRUE if the given level and category will be output by @ui, %FALSE
284 * otherwise.
285 *
286 * Since: 3.0.0
287 */
288 gboolean purple_debug_ui_is_enabled(PurpleDebugUi *ui, PurpleDebugLevel level, const gchar *category);
289
290 /**
291 * purple_debug_ui_print:
292 * @ui: The #PurpleDebugUi instance.
293 * @level: The #PurpleDebugLevel.
294 * @category: An optional category.
295 * @arg_s: The debug string to output.
296 *
297 * Outputs @arg_s via @ui with the given @level and optional @category.
298 *
299 * Since: 3.0.0
300 */
301 void purple_debug_ui_print(PurpleDebugUi *ui, PurpleDebugLevel level, const gchar *category, const gchar *arg_s);
302
303 /****************************************************************************** 246 /******************************************************************************
304 * Debug Subsystem 247 * Debug Subsystem
305 *****************************************************************************/ 248 *****************************************************************************/
306 249
307 /** 250 /**

mercurial