comparison src/debug.c @ 673:fbebf5cf4a55

Do not use printf() directly but use new wrapper function log_printf() instead.
author zas_
date Fri, 16 May 2008 12:16:49 +0000
parents 8268cbe682f1
children 6d6f042b8ca5
comparison
equal deleted inserted replaced
672:913eb0ba99a6 673:fbebf5cf4a55
8 * Please read the included file COPYING for more information. 8 * Please read the included file COPYING for more information.
9 * This software comes with no warranty of any kind, use at your own risk! 9 * This software comes with no warranty of any kind, use at your own risk!
10 */ 10 */
11 11
12 #include "main.h" 12 #include "main.h"
13
14
15 /*
16 * Logging functions
17 */
18
19 gint log_domain_printf(const char *domain, const gchar *format, ...)
20 {
21 va_list ap;
22 gchar buf[4096];
23 gint ret;
24
25 va_start(ap, format);
26 ret = vsnprintf(buf, sizeof(buf), format, ap);
27 va_end(ap);
28
29 puts(buf);
30
31 return ret;
32 }
33
34
35 /*
36 * Debugging only functions
37 */
13 38
14 #ifdef DEBUG 39 #ifdef DEBUG
15 40
16 static gint debug_level = DEBUG_LEVEL_MIN; 41 static gint debug_level = DEBUG_LEVEL_MIN;
17 42
94 void init_exec_time(void) 119 void init_exec_time(void)
95 { 120 {
96 get_exec_time(); 121 get_exec_time();
97 } 122 }
98 123
99 #endif 124 #endif /* DEBUG */