From a9e3b4f78e379a27d2cb369ac8fe40ed4f304894 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Tomko?= Date: Mon, 15 Oct 2012 09:14:26 +0200 Subject: [PATCH] util: switch virLogEatParams to virLogSource 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 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/util/logging.h b/src/util/logging.h index 4fe0c8eb52..c67377f0d2 100644 --- a/src/util/logging.h +++ b/src/util/logging.h @@ -25,6 +25,35 @@ # include "internal.h" # 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 @@ -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 -- 2.39.5