From 04bd0360f32ec628ecf7943b3fd1468d6eb2dde5 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Thu, 18 Nov 2010 13:14:08 +0000 Subject: [PATCH] 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 --- src/util/virterror.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/util/virterror.c b/src/util/virterror.c index 9757fd423f..83c4c9dcf0 100644 --- a/src/util/virterror.c +++ b/src/util/virterror.c @@ -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) { const char *dom = "unknown"; switch (domain) { @@ -716,7 +704,7 @@ virRaiseErrorFull(virConnectPtr conn ATTRIBUTE_UNUSED, * Hook up the error or warning to the logging facility * 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); /* -- GitLab