| 19 * You should have received a copy of the GNU General Public License |
19 * You should have received a copy of the GNU General Public License |
| 20 * along with this program; if not, write to the Free Software |
20 * along with this program; if not, write to the Free Software |
| 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 22 */ |
22 */ |
| 23 #include "debug.h" |
23 #include "debug.h" |
| |
24 #include <stdio.h> |
| 24 #include <stdlib.h> |
25 #include <stdlib.h> |
| 25 #include <glib.h> |
26 #include <glib.h> |
| 26 |
27 |
| 27 static GaimDebugUiOps *debug_ui_ops = NULL; |
28 static GaimDebugUiOps *debug_ui_ops = NULL; |
| 28 |
29 |
| 37 |
38 |
| 38 ops = gaim_debug_get_ui_ops(); |
39 ops = gaim_debug_get_ui_ops(); |
| 39 |
40 |
| 40 if (ops != NULL && ops->print != NULL) |
41 if (ops != NULL && ops->print != NULL) |
| 41 ops->print(level, category, format, args); |
42 ops->print(level, category, format, args); |
| |
43 else { |
| |
44 /* fallback for pre ops init period */ |
| |
45 char *str = g_strdup_vprintf(format, args); |
| |
46 printf("%s%s%s", category?category:"", category?": ":"",str); |
| |
47 g_free(str); |
| |
48 } |
| 42 } |
49 } |
| 43 |
50 |
| 44 void |
51 void |
| 45 gaim_debug(GaimDebugLevel level, const char *category, |
52 gaim_debug(GaimDebugLevel level, const char *category, |
| 46 const char *format, ...) |
53 const char *format, ...) |