提交 a9e3b4f7 编写于 作者: J Ján Tomko 提交者: Michal Privoznik

util: switch virLogEatParams to virLogSource

Commit e8fd8757 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.
上级 f81f0f2f
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册