[Spice-devel] [spice-common PATCH v1 2/13] log: include message log level for parity with glib

Victor Toso victortoso at redhat.com
Fri Dec 11 07:54:48 PST 2015


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

diff --git a/common/log.c b/common/log.c
index aee6cc7..fb68708 100644
--- a/common/log.c
+++ b/common/log.c
@@ -47,6 +47,7 @@ static GLogLevelFlags spice_log_level_to_glib(SpiceLogLevel level)
         [ SPICE_LOG_LEVEL_ERROR ] = G_LOG_LEVEL_ERROR,
         [ SPICE_LOG_LEVEL_CRITICAL ] = G_LOG_LEVEL_CRITICAL,
         [ SPICE_LOG_LEVEL_WARNING ] = G_LOG_LEVEL_WARNING,
+        [ SPICE_LOG_LEVEL_MESSAGE ] = G_LOG_LEVEL_MESSAGE,
         [ SPICE_LOG_LEVEL_INFO ] = G_LOG_LEVEL_INFO,
         [ SPICE_LOG_LEVEL_DEBUG ] = G_LOG_LEVEL_DEBUG,
     };
diff --git a/common/log.h b/common/log.h
index 4be201d..8a85369 100644
--- a/common/log.h
+++ b/common/log.h
@@ -36,6 +36,7 @@ typedef enum {
     SPICE_LOG_LEVEL_ERROR,
     SPICE_LOG_LEVEL_CRITICAL,
     SPICE_LOG_LEVEL_WARNING,
+    SPICE_LOG_LEVEL_MESSAGE,
     SPICE_LOG_LEVEL_INFO,
     SPICE_LOG_LEVEL_DEBUG,
 } SpiceLogLevel;
@@ -86,6 +87,9 @@ void spice_log(const char *log_domain,
 #define spice_warning(format, ...) \
     SPICE_LOG(SPICE_LOG_DOMAIN, SPICE_LOG_LEVEL_WARNING, format, ## __VA_ARGS__)
 
+#define spice_message(format, ...) \
+    SPICE_LOG(SPICE_LOG_DOMAIN, SPICE_LOG_LEVEL_MESSAGE, format, ## __VA_ARGS__)
+
 #define spice_critical(format, ...) \
     SPICE_LOG(SPICE_LOG_DOMAIN, SPICE_LOG_LEVEL_CRITICAL, format, ## __VA_ARGS__)
 
-- 
2.5.0



More information about the Spice-devel mailing list