[spice-common PATCH v1 3/13] log: Always use Spice domain for glib

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 common/Makefile.am | 1 +
 common/log.c       | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/common/Makefile.am b/common/Makefile.am
index 7382509..042fa97 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -91,6 +91,7 @@ endif
 
 AM_CPPFLAGS =				\
 	-I$(top_srcdir)			\
+	-DG_LOG_DOMAIN=\"Spice\"	\
 	$(SPICE_COMMON_CFLAGS)		\
 	$(PROTOCOL_CFLAGS)		\
 	$(NULL)
diff --git a/common/log.c b/common/log.c
index fb68708..19a58f0 100644
--- a/common/log.c
+++ b/common/log.c
@@ -85,7 +85,7 @@ static void spice_log_set_abort_level(void)
                     fatal_mask |= glib_abort_level;
                     glib_abort_level >>= 1;
                 }
-                g_log_set_fatal_mask(SPICE_LOG_DOMAIN, fatal_mask);
+                g_log_set_fatal_mask(G_LOG_DOMAIN, fatal_mask);
             }
         } else {
             abort_level = SPICE_ABORT_LEVEL_DEFAULT;
@@ -117,7 +117,8 @@ static void spice_logv(const char *log_domain,
     if (format) {
         g_string_append_vprintf(log_msg, format, args);
     }
-    g_log(log_domain, spice_log_level_to_glib(log_level), "%s", log_msg->str);
+    g_log(G_LOG_DOMAIN, spice_log_level_to_glib(log_level),
+          "[%s] %s", log_domain, log_msg->str);
     g_string_free(log_msg, TRUE);
 
     if (abort_level != -1 && abort_level >= (int) log_level) {
-- 
2.5.0

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]