[PATCH] Log all errors at level INFO to stop polluting syslog

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 files changed, 1 insertions(+), 13 deletions(-)

diff --git a/src/util/virterror.c b/src/util/virterror.c
index d524d04..ecd9fc9 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) {
@@ -719,7 +707,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);
 
     /*
-- 
1.7.2.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]