mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 11:52:20 +00:00
Change logging category parameter into an enum
The 'const char *category' parameter only has a few possible values now that the filename has been separated. Turn this parameter into an enum instead. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
0225c566f4
commit
e8fd8757c8
@ -349,7 +349,8 @@
|
|||||||
|
|
||||||
# define PROBE_EXPAND(NAME, ARGS) NAME(ARGS)
|
# define PROBE_EXPAND(NAME, ARGS) NAME(ARGS)
|
||||||
# define PROBE(NAME, FMT, ...) \
|
# define PROBE(NAME, FMT, ...) \
|
||||||
VIR_DEBUG_INT("trace", __FILE__, __LINE__, __func__, \
|
VIR_DEBUG_INT(VIR_LOG_FROM_TRACE, \
|
||||||
|
__FILE__, __LINE__, __func__, \
|
||||||
#NAME ": " FMT, __VA_ARGS__); \
|
#NAME ": " FMT, __VA_ARGS__); \
|
||||||
if (LIBVIRT_ ## NAME ## _ENABLED()) { \
|
if (LIBVIRT_ ## NAME ## _ENABLED()) { \
|
||||||
PROBE_EXPAND(LIBVIRT_ ## NAME, \
|
PROBE_EXPAND(LIBVIRT_ ## NAME, \
|
||||||
@ -357,7 +358,8 @@
|
|||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
# define PROBE(NAME, FMT, ...) \
|
# define PROBE(NAME, FMT, ...) \
|
||||||
VIR_DEBUG_INT("trace", __FILE__, __LINE__, __func__, \
|
VIR_DEBUG_INT(VIR_LOG_FROM_TRACE, \
|
||||||
|
__FILE__, __LINE__, __func__, \
|
||||||
#NAME ": " FMT, __VA_ARGS__);
|
#NAME ": " FMT, __VA_ARGS__);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
@ -358,7 +358,7 @@ static void udevLogFunction(struct udev *udev ATTRIBUTE_UNUSED,
|
|||||||
const char *fmt,
|
const char *fmt,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
VIR_ERROR_INT("library", file, line, fn, fmt, args);
|
VIR_ERROR_INT(VIR_LOG_FROM_LIBRARY, file, line, fn, fmt, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,9 +52,6 @@
|
|||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_UML
|
#define VIR_FROM_THIS VIR_FROM_UML
|
||||||
|
|
||||||
#define umlLog(level, msg, ...) \
|
|
||||||
virLogMessage(__FILE__, level, 0, msg, __VA_ARGS__)
|
|
||||||
|
|
||||||
|
|
||||||
static int umlDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
|
static int umlDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
|
@ -47,6 +47,14 @@
|
|||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_NONE
|
#define VIR_FROM_THIS VIR_FROM_NONE
|
||||||
|
|
||||||
|
VIR_ENUM_DECL(virLogSource)
|
||||||
|
VIR_ENUM_IMPL(virLogSource, VIR_LOG_FROM_LAST,
|
||||||
|
"file",
|
||||||
|
"error",
|
||||||
|
"audit",
|
||||||
|
"trace",
|
||||||
|
"library");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A logging buffer to keep some history over logs
|
* A logging buffer to keep some history over logs
|
||||||
*/
|
*/
|
||||||
@ -98,7 +106,7 @@ static virLogPriority virLogDefaultPriority = VIR_LOG_DEFAULT;
|
|||||||
|
|
||||||
static int virLogResetFilters(void);
|
static int virLogResetFilters(void);
|
||||||
static int virLogResetOutputs(void);
|
static int virLogResetOutputs(void);
|
||||||
static void virLogOutputToFd(const char *category,
|
static void virLogOutputToFd(virLogSource src,
|
||||||
virLogPriority priority,
|
virLogPriority priority,
|
||||||
const char *filename,
|
const char *filename,
|
||||||
int linenr,
|
int linenr,
|
||||||
@ -703,11 +711,11 @@ virLogVersionString(const char **rawmsg,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* virLogMessage:
|
* virLogMessage:
|
||||||
* @category: where is that message coming from
|
* @source: where is that message coming from
|
||||||
* @priority: the priority level
|
* @priority: the priority level
|
||||||
* @funcname: the function emitting the (debug) message
|
* @filename: file where the message was emitted
|
||||||
* @linenr: line where the message was emitted
|
* @linenr: line where the message was emitted
|
||||||
* @flags: extra flags, 1 if coming from the error handler
|
* @funcname: the function emitting the (debug) message
|
||||||
* @fmt: the string format
|
* @fmt: the string format
|
||||||
* @...: the arguments
|
* @...: the arguments
|
||||||
*
|
*
|
||||||
@ -715,30 +723,29 @@ virLogVersionString(const char **rawmsg,
|
|||||||
* the message may be stored, sent to output or just discarded
|
* the message may be stored, sent to output or just discarded
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
virLogMessage(const char *category,
|
virLogMessage(virLogSource source,
|
||||||
virLogPriority priority,
|
virLogPriority priority,
|
||||||
const char *filename,
|
const char *filename,
|
||||||
int linenr,
|
int linenr,
|
||||||
const char *funcname,
|
const char *funcname,
|
||||||
unsigned int flags,
|
|
||||||
const char *fmt, ...)
|
const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
virLogVMessage(category, priority,
|
virLogVMessage(source, priority,
|
||||||
filename, linenr, funcname,
|
filename, linenr, funcname,
|
||||||
flags, fmt, ap);
|
fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virLogVMessage:
|
* virLogVMessage:
|
||||||
* @category: where is that message coming from
|
* @source: where is that message coming from
|
||||||
* @priority: the priority level
|
* @priority: the priority level
|
||||||
* @funcname: the function emitting the (debug) message
|
* @filename: file where the message was emitted
|
||||||
* @linenr: line where the message was emitted
|
* @linenr: line where the message was emitted
|
||||||
* @flags: extra flags, 1 if coming from the error handler
|
* @funcname: the function emitting the (debug) message
|
||||||
* @fmt: the string format
|
* @fmt: the string format
|
||||||
* @vargs: format args
|
* @vargs: format args
|
||||||
*
|
*
|
||||||
@ -746,12 +753,11 @@ virLogMessage(const char *category,
|
|||||||
* the message may be stored, sent to output or just discarded
|
* the message may be stored, sent to output or just discarded
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
virLogVMessage(const char *category,
|
virLogVMessage(virLogSource source,
|
||||||
virLogPriority priority,
|
virLogPriority priority,
|
||||||
const char *filename,
|
const char *filename,
|
||||||
int linenr,
|
int linenr,
|
||||||
const char *funcname,
|
const char *funcname,
|
||||||
unsigned int flags,
|
|
||||||
const char *fmt,
|
const char *fmt,
|
||||||
va_list vargs)
|
va_list vargs)
|
||||||
{
|
{
|
||||||
@ -773,7 +779,7 @@ virLogVMessage(const char *category,
|
|||||||
/*
|
/*
|
||||||
* check against list of specific logging patterns
|
* check against list of specific logging patterns
|
||||||
*/
|
*/
|
||||||
fprio = virLogFiltersCheck(category, &filterflags);
|
fprio = virLogFiltersCheck(filename, &filterflags);
|
||||||
if (fprio == 0) {
|
if (fprio == 0) {
|
||||||
if (priority < virLogDefaultPriority)
|
if (priority < virLogDefaultPriority)
|
||||||
emit = 0;
|
emit = 0;
|
||||||
@ -820,32 +826,32 @@ virLogVMessage(const char *category,
|
|||||||
const char *rawver;
|
const char *rawver;
|
||||||
char *ver = NULL;
|
char *ver = NULL;
|
||||||
if (virLogVersionString(&rawver, &ver) >= 0)
|
if (virLogVersionString(&rawver, &ver) >= 0)
|
||||||
virLogOutputs[i].f(category, VIR_LOG_INFO,
|
virLogOutputs[i].f(VIR_LOG_FROM_FILE, VIR_LOG_INFO,
|
||||||
__FILE__, __LINE__, __func__,
|
__FILE__, __LINE__, __func__,
|
||||||
timestamp, 0, rawver, ver,
|
timestamp, 0, rawver, ver,
|
||||||
virLogOutputs[i].data);
|
virLogOutputs[i].data);
|
||||||
VIR_FREE(ver);
|
VIR_FREE(ver);
|
||||||
virLogOutputs[i].logVersion = false;
|
virLogOutputs[i].logVersion = false;
|
||||||
}
|
}
|
||||||
virLogOutputs[i].f(category, priority,
|
virLogOutputs[i].f(source, priority,
|
||||||
filename, linenr, funcname,
|
filename, linenr, funcname,
|
||||||
timestamp, filterflags,
|
timestamp, filterflags,
|
||||||
str, msg, virLogOutputs[i].data);
|
str, msg, virLogOutputs[i].data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((virLogNbOutputs == 0) && (flags != 1)) {
|
if ((virLogNbOutputs == 0) && (source != VIR_LOG_FROM_ERROR)) {
|
||||||
if (logVersionStderr) {
|
if (logVersionStderr) {
|
||||||
const char *rawver;
|
const char *rawver;
|
||||||
char *ver = NULL;
|
char *ver = NULL;
|
||||||
if (virLogVersionString(&rawver, &ver) >= 0)
|
if (virLogVersionString(&rawver, &ver) >= 0)
|
||||||
virLogOutputToFd(category, VIR_LOG_INFO,
|
virLogOutputToFd(VIR_LOG_FROM_FILE, VIR_LOG_INFO,
|
||||||
__FILE__, __LINE__, __func__,
|
__FILE__, __LINE__, __func__,
|
||||||
timestamp, 0, rawver, ver,
|
timestamp, 0, rawver, ver,
|
||||||
(void *) STDERR_FILENO);
|
(void *) STDERR_FILENO);
|
||||||
VIR_FREE(ver);
|
VIR_FREE(ver);
|
||||||
logVersionStderr = false;
|
logVersionStderr = false;
|
||||||
}
|
}
|
||||||
virLogOutputToFd(category, priority,
|
virLogOutputToFd(source, priority,
|
||||||
filename, linenr, funcname,
|
filename, linenr, funcname,
|
||||||
timestamp, filterflags,
|
timestamp, filterflags,
|
||||||
str, msg, (void *) STDERR_FILENO);
|
str, msg, (void *) STDERR_FILENO);
|
||||||
@ -880,7 +886,7 @@ virLogStackTraceToFd(int fd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
virLogOutputToFd(const char *category ATTRIBUTE_UNUSED,
|
virLogOutputToFd(virLogSource source ATTRIBUTE_UNUSED,
|
||||||
virLogPriority priority ATTRIBUTE_UNUSED,
|
virLogPriority priority ATTRIBUTE_UNUSED,
|
||||||
const char *filename ATTRIBUTE_UNUSED,
|
const char *filename ATTRIBUTE_UNUSED,
|
||||||
int linenr ATTRIBUTE_UNUSED,
|
int linenr ATTRIBUTE_UNUSED,
|
||||||
@ -966,7 +972,7 @@ virLogPrioritySyslog(virLogPriority priority)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
virLogOutputToSyslog(const char *category ATTRIBUTE_UNUSED,
|
virLogOutputToSyslog(virLogSource source ATTRIBUTE_UNUSED,
|
||||||
virLogPriority priority,
|
virLogPriority priority,
|
||||||
const char *filename ATTRIBUTE_UNUSED,
|
const char *filename ATTRIBUTE_UNUSED,
|
||||||
int linenr ATTRIBUTE_UNUSED,
|
int linenr ATTRIBUTE_UNUSED,
|
||||||
|
@ -31,8 +31,8 @@
|
|||||||
* defined at runtime from the libvirt daemon configuration file
|
* defined at runtime from the libvirt daemon configuration file
|
||||||
*/
|
*/
|
||||||
# ifdef ENABLE_DEBUG
|
# ifdef ENABLE_DEBUG
|
||||||
# define VIR_DEBUG_INT(category, filename, linenr, funcname, ...) \
|
# define VIR_DEBUG_INT(src, filename, linenr, funcname, ...) \
|
||||||
virLogMessage(category, VIR_LOG_DEBUG, filename, linenr, funcname, 0, __VA_ARGS__)
|
virLogMessage(src, VIR_LOG_DEBUG, filename, linenr, funcname, __VA_ARGS__)
|
||||||
# else
|
# else
|
||||||
/**
|
/**
|
||||||
* virLogEatParams:
|
* virLogEatParams:
|
||||||
@ -44,25 +44,25 @@ static inline void virLogEatParams(const char *unused, ...)
|
|||||||
/* Silence gcc */
|
/* Silence gcc */
|
||||||
unused = unused;
|
unused = unused;
|
||||||
}
|
}
|
||||||
# define VIR_DEBUG_INT(category, filename, linenr, funcname, ...) \
|
# define VIR_DEBUG_INT(src, filename, linenr, funcname, ...) \
|
||||||
virLogEatParams(category, filename, linenr, funcname, __VA_ARGS__)
|
virLogEatParams(src, filename, linenr, funcname, __VA_ARGS__)
|
||||||
# endif /* !ENABLE_DEBUG */
|
# endif /* !ENABLE_DEBUG */
|
||||||
|
|
||||||
# define VIR_INFO_INT(category, filename, linenr, funcname, ...) \
|
# define VIR_INFO_INT(src, filename, linenr, funcname, ...) \
|
||||||
virLogMessage(category, VIR_LOG_INFO, filename, linenr, funcname, 0, __VA_ARGS__)
|
virLogMessage(src, VIR_LOG_INFO, filename, linenr, funcname, __VA_ARGS__)
|
||||||
# define VIR_WARN_INT(category, filename, linenr, funcname, ...) \
|
# define VIR_WARN_INT(src, filename, linenr, funcname, ...) \
|
||||||
virLogMessage(category, VIR_LOG_WARN, filename, linenr, funcname, 0, __VA_ARGS__)
|
virLogMessage(src, VIR_LOG_WARN, filename, linenr, funcname, __VA_ARGS__)
|
||||||
# define VIR_ERROR_INT(category, filename, linenr, funcname, ...) \
|
# define VIR_ERROR_INT(src, filename, linenr, funcname, ...) \
|
||||||
virLogMessage(category, VIR_LOG_ERROR, filename, linenr, funcname, 0, __VA_ARGS__)
|
virLogMessage(src, VIR_LOG_ERROR, filename, linenr, funcname, __VA_ARGS__)
|
||||||
|
|
||||||
# define VIR_DEBUG(...) \
|
# define VIR_DEBUG(...) \
|
||||||
VIR_DEBUG_INT("file", __FILE__, __LINE__, __func__, __VA_ARGS__)
|
VIR_DEBUG_INT(VIR_LOG_FROM_FILE, __FILE__, __LINE__, __func__, __VA_ARGS__)
|
||||||
# define VIR_INFO(...) \
|
# define VIR_INFO(...) \
|
||||||
VIR_INFO_INT("file", __FILE__, __LINE__, __func__, __VA_ARGS__)
|
VIR_INFO_INT(VIR_LOG_FROM_FILE, __FILE__, __LINE__, __func__, __VA_ARGS__)
|
||||||
# define VIR_WARN(...) \
|
# define VIR_WARN(...) \
|
||||||
VIR_WARN_INT("file", __FILE__, __LINE__, __func__, __VA_ARGS__)
|
VIR_WARN_INT(VIR_LOG_FROM_FILE, __FILE__, __LINE__, __func__, __VA_ARGS__)
|
||||||
# define VIR_ERROR(...) \
|
# define VIR_ERROR(...) \
|
||||||
VIR_ERROR_INT("file", __FILE__, __LINE__, __func__, __VA_ARGS__)
|
VIR_ERROR_INT(VIR_LOG_FROM_FILE, __FILE__, __LINE__, __func__, __VA_ARGS__)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* To be made public
|
* To be made public
|
||||||
@ -82,12 +82,23 @@ typedef enum {
|
|||||||
VIR_LOG_TO_FILE,
|
VIR_LOG_TO_FILE,
|
||||||
} virLogDestination;
|
} 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:
|
* virLogOutputFunc:
|
||||||
* @category: the category for the message
|
* @src: the src for the message
|
||||||
* @priority: the priority for the message
|
* @priority: the priority for the message
|
||||||
* @funcname: the function emitting the message
|
* @filename: file where the message was emitted
|
||||||
* @linenr: line where the message was emitted
|
* @linenr: line where the message was emitted
|
||||||
|
* @funcname: the function emitting the message
|
||||||
* @timestamp: zero terminated string with timestamp of the message
|
* @timestamp: zero terminated string with timestamp of the message
|
||||||
* @flags: flags associated with the message
|
* @flags: flags associated with the message
|
||||||
* @rawstr: the unformatted message to log, zero terminated
|
* @rawstr: the unformatted message to log, zero terminated
|
||||||
@ -96,7 +107,7 @@ typedef enum {
|
|||||||
*
|
*
|
||||||
* Callback function used to output messages
|
* Callback function used to output messages
|
||||||
*/
|
*/
|
||||||
typedef void (*virLogOutputFunc) (const char *category,
|
typedef void (*virLogOutputFunc) (virLogSource src,
|
||||||
virLogPriority priority,
|
virLogPriority priority,
|
||||||
const char *filename,
|
const char *filename,
|
||||||
int linenr,
|
int linenr,
|
||||||
@ -147,21 +158,19 @@ extern int virLogReset(void);
|
|||||||
extern int virLogParseDefaultPriority(const char *priority);
|
extern int virLogParseDefaultPriority(const char *priority);
|
||||||
extern int virLogParseFilters(const char *filters);
|
extern int virLogParseFilters(const char *filters);
|
||||||
extern int virLogParseOutputs(const char *output);
|
extern int virLogParseOutputs(const char *output);
|
||||||
extern void virLogMessage(const char *category,
|
extern void virLogMessage(virLogSource src,
|
||||||
virLogPriority priority,
|
virLogPriority priority,
|
||||||
const char *filename,
|
const char *filename,
|
||||||
int linenr,
|
int linenr,
|
||||||
const char *funcname,
|
const char *funcname,
|
||||||
unsigned int flags,
|
const char *fmt, ...) ATTRIBUTE_FMT_PRINTF(6, 7);
|
||||||
const char *fmt, ...) ATTRIBUTE_FMT_PRINTF(7, 8);
|
extern void virLogVMessage(virLogSource src,
|
||||||
extern void virLogVMessage(const char *category,
|
|
||||||
virLogPriority priority,
|
virLogPriority priority,
|
||||||
const char *filename,
|
const char *filename,
|
||||||
int linenr,
|
int linenr,
|
||||||
const char *funcname,
|
const char *funcname,
|
||||||
unsigned int flags,
|
|
||||||
const char *fmt,
|
const char *fmt,
|
||||||
va_list vargs) ATTRIBUTE_FMT_PRINTF(7, 0);
|
va_list vargs) ATTRIBUTE_FMT_PRINTF(6, 0);
|
||||||
extern int virLogSetBufferSize(int size);
|
extern int virLogSetBufferSize(int size);
|
||||||
extern void virLogEmergencyDumpAll(int signum);
|
extern void virLogEmergencyDumpAll(int signum);
|
||||||
#endif
|
#endif
|
||||||
|
@ -74,8 +74,9 @@ void virAuditLog(int logging)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void virAuditSend(const char *file ATTRIBUTE_UNUSED, const char *func,
|
void virAuditSend(const char *filename,
|
||||||
size_t linenr,
|
size_t linenr,
|
||||||
|
const char *funcname,
|
||||||
const char *clienttty ATTRIBUTE_UNUSED,
|
const char *clienttty ATTRIBUTE_UNUSED,
|
||||||
const char *clientaddr ATTRIBUTE_UNUSED,
|
const char *clientaddr ATTRIBUTE_UNUSED,
|
||||||
enum virAuditRecordType type ATTRIBUTE_UNUSED, bool success,
|
enum virAuditRecordType type ATTRIBUTE_UNUSED, bool success,
|
||||||
@ -103,10 +104,12 @@ void virAuditSend(const char *file ATTRIBUTE_UNUSED, const char *func,
|
|||||||
|
|
||||||
if (auditlog && str) {
|
if (auditlog && str) {
|
||||||
if (success)
|
if (success)
|
||||||
virLogMessage("audit", VIR_LOG_INFO, file, linenr, func, 0,
|
virLogMessage(VIR_LOG_FROM_AUDIT, VIR_LOG_INFO,
|
||||||
|
filename, linenr, funcname,
|
||||||
"success=yes %s", str);
|
"success=yes %s", str);
|
||||||
else
|
else
|
||||||
virLogMessage("audit", VIR_LOG_WARN, file, linenr, func, 0,
|
virLogMessage(VIR_LOG_FROM_AUDIT, VIR_LOG_WARN,
|
||||||
|
filename, linenr, funcname,
|
||||||
"success=no %s", str);
|
"success=no %s", str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ int virAuditOpen(void);
|
|||||||
|
|
||||||
void virAuditLog(int enabled);
|
void virAuditLog(int enabled);
|
||||||
|
|
||||||
void virAuditSend(const char *file, const char *func, size_t linenr,
|
void virAuditSend(const char *filename, size_t linenr, const char *funcname,
|
||||||
const char *clienttty, const char *clientaddr,
|
const char *clienttty, const char *clientaddr,
|
||||||
enum virAuditRecordType type, bool success,
|
enum virAuditRecordType type, bool success,
|
||||||
const char *fmt, ...)
|
const char *fmt, ...)
|
||||||
@ -46,11 +46,11 @@ char *virAuditEncode(const char *key, const char *value);
|
|||||||
void virAuditClose(void);
|
void virAuditClose(void);
|
||||||
|
|
||||||
# define VIR_AUDIT(type, success, ...) \
|
# define VIR_AUDIT(type, success, ...) \
|
||||||
virAuditSend(__FILE__, __func__, __LINE__, \
|
virAuditSend(__FILE__, __LINE__, __func__, \
|
||||||
NULL, NULL, type, success, __VA_ARGS__);
|
NULL, NULL, type, success, __VA_ARGS__);
|
||||||
|
|
||||||
# define VIR_AUDIT_USER(type, success, clienttty, clientaddr, ...) \
|
# define VIR_AUDIT_USER(type, success, clienttty, clientaddr, ...) \
|
||||||
virAuditSend(__FILE__, __func__, __LINE__, \
|
virAuditSend(__FILE__, __LINE__, __func__, \
|
||||||
clienttty, clientaddr, type, success, __VA_ARGS__);
|
clienttty, clientaddr, type, success, __VA_ARGS__);
|
||||||
|
|
||||||
# define VIR_AUDIT_STR(str) \
|
# define VIR_AUDIT_STR(str) \
|
||||||
|
@ -671,14 +671,13 @@ virRaiseErrorFull(const char *filename ATTRIBUTE_UNUSED,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Hook up the error or warning to the logging facility
|
* Hook up the error or warning to the logging facility
|
||||||
* XXXX should we include filename as 'category' instead of domain name ?
|
|
||||||
*/
|
*/
|
||||||
priority = virErrorLevelPriority(level);
|
priority = virErrorLevelPriority(level);
|
||||||
if (virErrorLogPriorityFilter)
|
if (virErrorLogPriorityFilter)
|
||||||
priority = virErrorLogPriorityFilter(to, priority);
|
priority = virErrorLogPriorityFilter(to, priority);
|
||||||
virLogMessage("error", priority,
|
virLogMessage(virErrorLogPriorityFilter ? VIR_LOG_FROM_FILE : VIR_LOG_FROM_ERROR,
|
||||||
|
priority,
|
||||||
filename, linenr, funcname,
|
filename, linenr, funcname,
|
||||||
virErrorLogPriorityFilter ? 0 : 1,
|
|
||||||
"%s", str);
|
"%s", str);
|
||||||
|
|
||||||
errno = save_errno;
|
errno = save_errno;
|
||||||
|
@ -480,7 +480,7 @@ struct virtTestLogData {
|
|||||||
static struct virtTestLogData testLog = { VIR_BUFFER_INITIALIZER };
|
static struct virtTestLogData testLog = { VIR_BUFFER_INITIALIZER };
|
||||||
|
|
||||||
static void
|
static void
|
||||||
virtTestLogOutput(const char *category ATTRIBUTE_UNUSED,
|
virtTestLogOutput(virLogSource source ATTRIBUTE_UNUSED,
|
||||||
virLogPriority priority ATTRIBUTE_UNUSED,
|
virLogPriority priority ATTRIBUTE_UNUSED,
|
||||||
const char *filename ATTRIBUTE_UNUSED,
|
const char *filename ATTRIBUTE_UNUSED,
|
||||||
int lineno ATTRIBUTE_UNUSED,
|
int lineno ATTRIBUTE_UNUSED,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user