Mercurial > pidgin
comparison src/debug.c @ 7520:f25119847c5b
[gaim-migrate @ 8133]
If debug ops have not been set fall back to printf in gaim_debug
committer: Tailor Script <tailor@pidgin.im>
| author | Herman Bloggs <hermanator12002@yahoo.com> |
|---|---|
| date | Sun, 16 Nov 2003 01:46:19 +0000 |
| parents | feb3d21a7794 |
| children | 7398a8d6862d |
comparison
equal
deleted
inserted
replaced
| 7519:c57206d8753f | 7520:f25119847c5b |
|---|---|
| 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, ...) |
