common: fix up logging macros, add a global G_LOG_DOMAIN
authorAlexander Kanavin <alexander.kanavin@intel.com>
Tue, 26 Feb 2013 12:47:16 +0000 (14:47 +0200)
committerAlexander Kanavin <alexander.kanavin@intel.com>
Tue, 26 Feb 2013 12:47:16 +0000 (14:47 +0200)
configure.ac
include/gsignond/gsignond-log.h
test/daemon/Makefile.am

index 11c890d..c6af455 100644 (file)
@@ -54,7 +54,7 @@ GTK_DOC_CHECK
 AC_CHECK_HEADERS([string.h])
 
 # Checks for typedefs, structures, and compiler characteristics.
-GSIGNOND_CFLAGS="$GSIGNOND_CFLAGS -Wall"
+GSIGNOND_CFLAGS="$GSIGNOND_CFLAGS -Wall -DG_LOG_DOMAIN=\\\"gsignond\\\""
 
 # Checks for library functions.
 
index e06ae09..d8202e9 100644 (file)
 
 #include <glib.h>
 
-/*
- * TODO: Currently logging is directed to stdio, should resolve this properly
- */
-#define INFO(frmt, args...) g_print("[I] %s:%d  " frmt "\n", __func__, __LINE__, ##args)
-#define ERR(frmt, args...)  g_error("[E] %s:%d  " frmt , __func__, __LINE__, ##args)
-#define WARN(frmt, args...)  g_warning("[W] %s:%d  " frmt , __func__, __LINE__, ##args)
-#define DBG(frmt, args...)  g_debug("[D] %s:%d  " frmt , __func__, __LINE__, ##args)
+#define INFO(frmt, args...) g_message("%s:%d  " frmt , __FILE__, __LINE__, ##args)
+#define ERR(frmt, args...)  g_error("%s:%d  " frmt , __FILE__, __LINE__, ##args)
+#define WARN(frmt, args...)  g_warning("%s:%d  " frmt , __FILE__, __LINE__, ##args)
+#define DBG(frmt, args...)  g_debug("%s:%d  " frmt , __FILE__, __LINE__, ##args)
 
 #endif /* __GSIGNOND_LOG_H_ */
index 89f28f8..9d94f17 100644 (file)
@@ -10,6 +10,7 @@ daemontest_SOURCES = daemon-test.c
 daemontest_CFLAGS = \
     $(GSIGNOND_CFLAGS) \
     $(CHECK_CFLAGS) \
+    -U G_LOG_DOMAIN \
     -DG_LOG_DOMAIN=\"gsignond-test-server\" \
     -DGSIGNOND_TEST_DBUS_SERVICE_DIR=\""$(abs_top_builddir)/test/daemon/services"\" \
     -I$(top_srcdir) \