[libvirt] [PATCH] util: switch virLogEatParams to virLogSource

Ján Tomko jtomko at redhat.com
Mon Oct 15 07:14:26 UTC 2012


Commit e8fd8757c89abbd38571092bbb987650b7658aec changed 'const char *'
category to virLogSource enum. This changes it in virLogEatParams as
well, thus fixing the build with --disable-debug.
--
Hopefully moving the enum declarations is less ugly than using int.
---
 src/util/logging.h |   60 ++++++++++++++++++++++++++--------------------------
 1 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/src/util/logging.h b/src/util/logging.h
index 4fe0c8e..c67377f 100644
--- a/src/util/logging.h
+++ b/src/util/logging.h
@@ -26,6 +26,35 @@
 # include "buf.h"
 
 /*
+ * To be made public
+ */
+typedef enum {
+    VIR_LOG_DEBUG = 1,
+    VIR_LOG_INFO,
+    VIR_LOG_WARN,
+    VIR_LOG_ERROR,
+} virLogPriority;
+
+# define VIR_LOG_DEFAULT VIR_LOG_WARN
+
+typedef enum {
+    VIR_LOG_TO_STDERR = 1,
+    VIR_LOG_TO_SYSLOG,
+    VIR_LOG_TO_FILE,
+    VIR_LOG_TO_JOURNALD,
+} virLogDestination;
+
+typedef enum {
+    VIR_LOG_FROM_FILE,
+    VIR_LOG_FROM_ERROR,
+    VIR_LOG_FROM_AUDIT,
+    VIR_LOG_FROM_TRACE,
+    VIR_LOG_FROM_LIBRARY,
+
+    VIR_LOG_FROM_LAST,
+} virLogSource;
+
+/*
  * If configured with --enable-debug=yes then library calls
  * are printed to stderr for debugging or to an appropriate channel
  * defined at runtime from the libvirt daemon configuration file
@@ -39,7 +68,7 @@
  *
  * Do nothing but eat parameters.
  */
-static inline void virLogEatParams(const char *unused, ...)
+static inline void virLogEatParams(virLogSource unused, ...)
 {
     /* Silence gcc */
     unused = unused;
@@ -64,35 +93,6 @@ static inline void virLogEatParams(const char *unused, ...)
 # define VIR_ERROR(...)                                                 \
     VIR_ERROR_INT(VIR_LOG_FROM_FILE, __FILE__, __LINE__, __func__, __VA_ARGS__)
 
-/*
- * To be made public
- */
-typedef enum {
-    VIR_LOG_DEBUG = 1,
-    VIR_LOG_INFO,
-    VIR_LOG_WARN,
-    VIR_LOG_ERROR,
-} virLogPriority;
-
-# define VIR_LOG_DEFAULT VIR_LOG_WARN
-
-typedef enum {
-    VIR_LOG_TO_STDERR = 1,
-    VIR_LOG_TO_SYSLOG,
-    VIR_LOG_TO_FILE,
-    VIR_LOG_TO_JOURNALD,
-} virLogDestination;
-
-typedef enum {
-    VIR_LOG_FROM_FILE,
-    VIR_LOG_FROM_ERROR,
-    VIR_LOG_FROM_AUDIT,
-    VIR_LOG_FROM_TRACE,
-    VIR_LOG_FROM_LIBRARY,
-
-    VIR_LOG_FROM_LAST,
-} virLogSource;
-
 /**
  * virLogOutputFunc:
  * @src: the src for the message
-- 
1.7.8.6




More information about the libvir-list mailing list