changeset 11541:5fc015909164

[gaim-migrate @ 13796] Wrap the libgg debugging in gaim's debug functions committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 14 Sep 2005 03:41:32 +0000
parents 9ddda2a86f50
children cda814bad7f8
files src/protocols/gg/gg.c
diffstat 1 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/gg/gg.c	Wed Sep 14 03:08:50 2005 +0000
+++ b/src/protocols/gg/gg.c	Wed Sep 14 03:41:32 2005 +0000
@@ -1615,6 +1615,29 @@
 };
 /* }}} */
 
+static void gaim_gg_debug_handler(int level, const char * format, va_list args) {
+	GaimDebugLevel gaim_level;
+	char *msg = g_strdup_vprintf(format, args);
+
+	/* This is pretty pointless since the GG_DEBUG levels don't correspond to
+	 * the gaim ones */
+	switch (level) {
+		case GG_DEBUG_FUNCTION:
+			gaim_level = GAIM_DEBUG_INFO;
+			break;
+		case GG_DEBUG_MISC:
+		case GG_DEBUG_NET:
+		case GG_DEBUG_DUMP:
+		case GG_DEBUG_TRAFFIC:
+		default:
+			gaim_level = GAIM_DEBUG_MISC;
+			break;
+	}
+
+	gaim_debug(gaim_level, "gg", msg);
+	g_free(msg);
+}
+
 /*
  */
 /* static void init_plugin(GaimPlugin *plugin) {{{ */
@@ -1626,6 +1649,8 @@
 	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
 
 	my_protocol = plugin;
+
+	gg_debug_handler = gaim_gg_debug_handler;
 }
 /* }}} */