marvin_refactor: prepending marvin. to all logs Signed-off-by: Prasanna Santhanam <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8d70352b Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8d70352b Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8d70352b Branch: refs/heads/marvin-refactor Commit: 8d70352b74c5650bddf8545e0eb8098846cfab58 Parents: a0cdb61 Author: Prasanna Santhanam <[email protected]> Authored: Wed Oct 2 19:44:42 2013 +0530 Committer: Prasanna Santhanam <[email protected]> Committed: Wed Oct 2 20:28:13 2013 +0530 ---------------------------------------------------------------------- tools/marvin/marvin/TestCaseExecuteEngine.py | 4 ++-- tools/marvin/marvin/cloudstackConnection.py | 2 ++ tools/marvin/marvin/marvinPlugin.py | 6 +++--- tools/marvin/marvin/remoteSSHClient.py | 2 +- tools/marvin/marvin/util.py | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d70352b/tools/marvin/marvin/TestCaseExecuteEngine.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/TestCaseExecuteEngine.py b/tools/marvin/marvin/TestCaseExecuteEngine.py index c9796b8..1af9e34 100644 --- a/tools/marvin/marvin/TestCaseExecuteEngine.py +++ b/tools/marvin/marvin/TestCaseExecuteEngine.py @@ -48,7 +48,7 @@ class TestCaseExecuteEngine(object): if testcaseLogFile is not None: self.logfile = testcaseLogFile - self.logger = logging.getLogger("TestCaseExecuteEngine") + self.logger = logging.getLogger("marvin.TestCaseExecuteEngine") fh = logging.FileHandler(self.logfile) fh.setFormatter(self.logformat) self.logger.addHandler(fh) @@ -81,7 +81,7 @@ class TestCaseExecuteEngine(object): self.injectTestCase(test) else: #logger bears the name of the test class - testcaselogger = logging.getLogger("%s" % (test)) + testcaselogger = logging.getLogger("marvin.%s" % (test)) fh = logging.FileHandler(self.logfile) fh.setFormatter(self.logformat) testcaselogger.addHandler(fh) http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d70352b/tools/marvin/marvin/cloudstackConnection.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/cloudstackConnection.py b/tools/marvin/marvin/cloudstackConnection.py index 6cd65b7..86c989c 100644 --- a/tools/marvin/marvin/cloudstackConnection.py +++ b/tools/marvin/marvin/cloudstackConnection.py @@ -74,6 +74,8 @@ class CloudConnection(object): """ requests_log = logging.getLogger("requests") requests_log.setLevel(lvl) + factory_log = logging.getLogger("factory") + factory_log.setLevel(lvl) def poll(self, jobid, response): """ http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d70352b/tools/marvin/marvin/marvinPlugin.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/marvinPlugin.py b/tools/marvin/marvin/marvinPlugin.py index b98b5a6..fee3139 100644 --- a/tools/marvin/marvin/marvinPlugin.py +++ b/tools/marvin/marvin/marvinPlugin.py @@ -42,7 +42,7 @@ class MarvinPlugin(Plugin): "%(name)s - %(message)s") if options.debug_log: - self.logger = logging.getLogger("NoseTestExecuteEngine") + self.logger = logging.getLogger("marvin.NoseTestExecuteEngine") self.debug_stream = logging.FileHandler(options.debug_log) self.debug_stream.setFormatter(self.logformat) self.logger.addHandler(self.debug_stream) @@ -93,7 +93,7 @@ class MarvinPlugin(Plugin): Plugin.options(self, parser, env) def __init__(self): - self.identifier = None + self.identifier = '' Plugin.__init__(self) def prepareTestRunner(self, runner): @@ -122,7 +122,7 @@ class MarvinPlugin(Plugin): def beforeTest(self, test): testname = test.__str__().split()[0] self.testclient.identifier = '-'.join([self.identifier, testname]) - self.logger.name = test.__str__() + self.logger.name = "marvin.%s" % test.__str__() def _injectClients(self, test): self.debug_stream. \ http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d70352b/tools/marvin/marvin/remoteSSHClient.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/remoteSSHClient.py b/tools/marvin/marvin/remoteSSHClient.py index d64c82d..502fe46 100644 --- a/tools/marvin/marvin/remoteSSHClient.py +++ b/tools/marvin/marvin/remoteSSHClient.py @@ -32,7 +32,7 @@ class remoteSSHClient(object): self.keyPairFile = keyPairFileLocation self.ssh = paramiko.SSHClient() self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - self.logger = logging.getLogger('sshClient') + self.logger = logging.getLogger('marvin.sshClient') ch = logging.StreamHandler() ch.setLevel(log_lvl) self.logger.addHandler(ch) http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d70352b/tools/marvin/marvin/util.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/util.py b/tools/marvin/marvin/util.py index 93cb56b..175a851 100644 --- a/tools/marvin/marvin/util.py +++ b/tools/marvin/marvin/util.py @@ -202,7 +202,7 @@ def fetch_api_client(config_file='datacenterCfg'): """Fetch the Cloudstack API Client""" config = marvin.configGenerator.get_setup_config(config_file) mgt = config.mgtSvr[0] - testClientLogger = logging.getLogger("testClient") + testClientLogger = logging.getLogger("marvin.testClient") asyncTimeout = 3600 return cloudstackAPIClient.CloudStackAPIClient( marvin.cloudstackConnection.cloudConnection(
