You need to sign in or sign up before continuing.
提交 04bd0360 编写于 作者: D Daniel P. Berrange

Log all errors at level INFO to stop polluting syslog

Everytime a public API returns an error, libvirtd pollutes
syslog with that error message. Reduce the error logging
level to INFO so these don't appear by default.

* src/util/virterror.c: Log all errors at INFO
上级 882f78c3
...@@ -64,18 +64,6 @@ void *virUserData = NULL; /* associated data */ ...@@ -64,18 +64,6 @@ void *virUserData = NULL; /* associated data */
}} \ }} \
} }
static virLogPriority virErrorLevelPriority(virErrorLevel level) {
switch (level) {
case VIR_ERR_NONE:
return(VIR_LOG_INFO);
case VIR_ERR_WARNING:
return(VIR_LOG_WARN);
case VIR_ERR_ERROR:
return(VIR_LOG_ERROR);
}
return(VIR_LOG_ERROR);
}
static const char *virErrorDomainName(virErrorDomain domain) { static const char *virErrorDomainName(virErrorDomain domain) {
const char *dom = "unknown"; const char *dom = "unknown";
switch (domain) { switch (domain) {
...@@ -716,7 +704,7 @@ virRaiseErrorFull(virConnectPtr conn ATTRIBUTE_UNUSED, ...@@ -716,7 +704,7 @@ virRaiseErrorFull(virConnectPtr conn 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 ? * XXXX should we include filename as 'category' instead of domain name ?
*/ */
virLogMessage(virErrorDomainName(domain), virErrorLevelPriority(level), virLogMessage(virErrorDomainName(domain), VIR_LOG_INFO,
funcname, linenr, 1, "%s", str); funcname, linenr, 1, "%s", str);
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册