diff 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
line wrap: on
line diff
--- a/src/debug.c	Fri May 16 12:08:51 2008 +0000
+++ b/src/debug.c	Fri May 16 12:16:49 2008 +0000
@@ -11,6 +11,31 @@
 
 #include "main.h"
 
+
+/*
+ * Logging functions
+ */
+
+gint log_domain_printf(const char *domain, const gchar *format, ...)
+{
+	va_list ap;
+	gchar buf[4096];
+	gint ret;
+
+	va_start(ap, format);
+	ret = vsnprintf(buf, sizeof(buf), format, ap);
+	va_end(ap);
+
+	puts(buf);
+
+	return ret;
+}
+
+
+/*
+ * Debugging only functions
+ */
+
 #ifdef DEBUG
 
 static gint debug_level = DEBUG_LEVEL_MIN;
@@ -96,4 +121,4 @@
 	get_exec_time();
 }
 
-#endif
+#endif /* DEBUG */