Ignore certain modules for logging 71/31571/1
authorjose.lausuch <jose.lausuch@ericsson.com>
Tue, 21 Mar 2017 16:50:25 +0000 (17:50 +0100)
committerJose Lausuch <jose.lausuch@ericsson.com>
Thu, 23 Mar 2017 13:40:01 +0000 (13:40 +0000)
Some modules are logged to functest.log or the console
and are not relevant for us since they are already
in the openstack logs.
This causes a huge log which makes it unreadable.

Change-Id: I3f0fb83e2080e41cd5bf815f8448f5bc25e3464a
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
(cherry picked from commit d6f4f25e6269a23120b37f58178164740f1cf0e9)

functest/utils/functest_logger.py

index 022211c..555e9c2 100755 (executable)
@@ -28,13 +28,24 @@ import json
 
 from functest.utils.constants import CONST
 
+ignore = ["paramiko",
+          "stevedore.extension",
+          "keystoneauth.session",
+          "keystoneauth.identity.v3.base",
+          "novaclient.v2.client",
+          "neutronclient.v2_0.client",
+          "glanceclient.common.http",
+          "cinderclient.v2.client",
+          "cinderclient.client"]
+
 
 class Logger(object):
 
     def __init__(self, logger_name):
         self.setup_logging()
         self.logger = logging.getLogger(logger_name)
-        logging.getLogger("paramiko").setLevel(logging.WARNING)
+        for module_name in ignore:
+            logging.getLogger(module_name).setLevel(logging.WARNING)
 
     def getLogger(self):
         return self.logger