| 3 * @ingroup gtkui |
3 * @ingroup gtkui |
| 4 * |
4 * |
| 5 * gaim |
5 * gaim |
| 6 * |
6 * |
| 7 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org> |
7 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org> |
| 8 * |
8 * |
| 9 * This program is free software; you can redistribute it and/or modify |
9 * This program is free software; you can redistribute it and/or modify |
| 10 * it under the terms of the GNU General Public License as published by |
10 * it under the terms of the GNU General Public License as published by |
| 11 * the Free Software Foundation; either version 2 of the License, or |
11 * the Free Software Foundation; either version 2 of the License, or |
| 12 * (at your option) any later version. |
12 * (at your option) any later version. |
| 13 * |
13 * |
| 221 { |
221 { |
| 222 GaimDebugLevel level; |
222 GaimDebugLevel level; |
| 223 char *new_msg = NULL; |
223 char *new_msg = NULL; |
| 224 char *new_domain = NULL; |
224 char *new_domain = NULL; |
| 225 |
225 |
| 226 if ((flags & G_LOG_LEVEL_MASK) == G_LOG_LEVEL_ERROR) |
226 if ((flags & G_LOG_LEVEL_ERROR) == G_LOG_LEVEL_ERROR) |
| 227 level = GAIM_DEBUG_ERROR; |
227 level = GAIM_DEBUG_ERROR; |
| 228 else if ((flags & G_LOG_LEVEL_MASK) == G_LOG_LEVEL_CRITICAL) |
228 else if ((flags & G_LOG_LEVEL_CRITICAL) == G_LOG_LEVEL_CRITICAL) |
| 229 level = GAIM_DEBUG_FATAL; |
229 level = GAIM_DEBUG_FATAL; |
| 230 else if ((flags & G_LOG_LEVEL_MASK) == G_LOG_LEVEL_WARNING) |
230 else if ((flags & G_LOG_LEVEL_WARNING) == G_LOG_LEVEL_WARNING) |
| 231 level = GAIM_DEBUG_WARNING; |
231 level = GAIM_DEBUG_WARNING; |
| 232 else if ((flags & G_LOG_LEVEL_MASK) == G_LOG_LEVEL_MESSAGE) |
232 else if ((flags & G_LOG_LEVEL_MESSAGE) == G_LOG_LEVEL_MESSAGE) |
| 233 level = GAIM_DEBUG_INFO; |
233 level = GAIM_DEBUG_INFO; |
| 234 else if ((flags & G_LOG_LEVEL_MASK) == G_LOG_LEVEL_INFO) |
234 else if ((flags & G_LOG_LEVEL_INFO) == G_LOG_LEVEL_INFO) |
| 235 level = GAIM_DEBUG_INFO; |
235 level = GAIM_DEBUG_INFO; |
| 236 else if ((flags & G_LOG_LEVEL_MASK) == G_LOG_LEVEL_DEBUG) |
236 else if ((flags & G_LOG_LEVEL_DEBUG) == G_LOG_LEVEL_DEBUG) |
| 237 level = GAIM_DEBUG_MISC; |
237 level = GAIM_DEBUG_MISC; |
| 238 else { |
238 else |
| 239 gaim_debug(GAIM_DEBUG_WARNING, "gtkdebug", |
239 { |
| |
240 gaim_debug_warning("gtkdebug", |
| 240 "Unknown glib logging level in %d\n", flags); |
241 "Unknown glib logging level in %d\n", flags); |
| 241 |
242 |
| 242 level = GAIM_DEBUG_MISC; /* This will never happen. */ |
243 level = GAIM_DEBUG_MISC; /* This will never happen. */ |
| 243 } |
244 } |
| 244 |
245 |
| 246 new_msg = gaim_utf8_try_convert(msg); |
247 new_msg = gaim_utf8_try_convert(msg); |
| 247 |
248 |
| 248 if (domain != NULL) |
249 if (domain != NULL) |
| 249 new_domain = gaim_utf8_try_convert(domain); |
250 new_domain = gaim_utf8_try_convert(domain); |
| 250 |
251 |
| 251 if (new_msg != NULL) { |
252 if (new_msg != NULL) |
| 252 gaim_debug(GAIM_DEBUG_MISC, new_domain ? new_domain : "g_log", |
253 { |
| 253 "%s\n", new_msg); |
254 gaim_debug(level, (new_domain != NULL ? new_domain : "g_log"), |
| |
255 "%s\n", new_msg); |
| 254 |
256 |
| 255 g_free(new_msg); |
257 g_free(new_msg); |
| 256 } |
258 } |
| 257 |
259 |
| 258 if (new_domain != NULL) |
260 if (new_domain != NULL) |