comparison src/debug.c @ 11033:50224ac8184d

[gaim-migrate @ 12919] Ok, this is debug window filtering. Sadrul was going to do this with a text entry, but I like this better, feel free to disagree with me. It's not the prettiest in a couple places, most notable gtkmain.c where a bunch of categories that don't currently have a home get registered. I added some plugin_(un)load functions to some plugins to place the (un)register functions. Though I didn't do that for the prpls. Comments and cleanups welcome. (Oh, I've been seeing some crashes on quit, but I haven't been able to get it to happen reliably so I'm not sure if it's my code or some transient HEAD oscar/other crash.) committer: Tailor Script <tailor@pidgin.im>
author Etan Reisner <pidgin@unreliablesource.net>
date Tue, 28 Jun 2005 06:13:07 +0000
parents 6a20307ef8dc
children bb0d7b719af2
comparison
equal deleted inserted replaced
11032:31c1c48daba1 11033:50224ac8184d
38 * It doesn't matter what this value was the last time Gaim was 38 * It doesn't matter what this value was the last time Gaim was
39 * started, so it doesn't make sense to save it in prefs. 39 * started, so it doesn't make sense to save it in prefs.
40 */ 40 */
41 static gboolean debug_enabled = FALSE; 41 static gboolean debug_enabled = FALSE;
42 42
43 /* XXX I want to make this static but gg uses this for internal debug level
44 * stuff and I don't really feel like unwrapping it right now. -Etan */
43 void 45 void
44 gaim_debug_vargs(GaimDebugLevel level, const char *category, 46 gaim_debug_vargs(GaimDebugLevel level, const char *category,
45 const char *format, va_list args) 47 const char *format, va_list args)
46 { 48 {
47 GaimDebugUiOps *ops; 49 GaimDebugUiOps *ops;
154 gaim_debug_vargs(GAIM_DEBUG_FATAL, category, format, args); 156 gaim_debug_vargs(GAIM_DEBUG_FATAL, category, format, args);
155 va_end(args); 157 va_end(args);
156 } 158 }
157 159
158 void 160 void
161 gaim_debug_register_category(const char *category)
162 {
163 GaimDebugUiOps *ops;
164
165 g_return_if_fail(category != NULL);
166
167 ops = gaim_debug_get_ui_ops();
168
169 if (ops != NULL && ops->register_category != NULL)
170 ops->register_category(category);
171 }
172
173 void
174 gaim_debug_unregister_category(const char *category)
175 {
176 GaimDebugUiOps *ops;
177
178 g_return_if_fail(category != NULL);
179
180 ops = gaim_debug_get_ui_ops();
181
182 if (ops != NULL && ops->unregister_category != NULL)
183 ops->unregister_category(category);
184 }
185
186 void
159 gaim_debug_set_enabled(gboolean enabled) 187 gaim_debug_set_enabled(gboolean enabled)
160 { 188 {
161 debug_enabled = enabled; 189 debug_enabled = enabled;
162 } 190 }
163 191