# HG changeset patch # User Daniel Atallah # Date 1126669292 0 # Node ID 5fc015909164d9378188764a40835af4f19e7c11 # Parent 9ddda2a86f504ce04efbdcb627ac91d51f6f3da2 [gaim-migrate @ 13796] Wrap the libgg debugging in gaim's debug functions committer: Tailor Script diff -r 9ddda2a86f50 -r 5fc015909164 src/protocols/gg/gg.c --- 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; } /* }}} */