From f4f58091d820e69d4c3e2ad615a8a5501b1ba240 Mon Sep 17 00:00:00 2001 From: Prasanna Santhanam Date: Thu, 22 Mar 2012 23:16:48 +0530 Subject: [PATCH] reduce logging verbosity, set level to info reviewed-by: Kishan --- tools/testClient/cloudstackConnection.py | 16 +++++++--------- tools/testClient/deployDataCenter.py | 7 ++----- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/tools/testClient/cloudstackConnection.py b/tools/testClient/cloudstackConnection.py index 435ef3fd69a..0af8e3d0207 100644 --- a/tools/testClient/cloudstackConnection.py +++ b/tools/testClient/cloudstackConnection.py @@ -52,14 +52,14 @@ class cloudConnection(object): try: self.connection = urllib2.urlopen("http://%s:%d/client/api?%s"%(self.mgtSvr, self.port, requestUrl)) - self.logging.debug("sending request: %s"%requestUrl) + self.logging.debug("sending GET request: %s"%requestUrl) response = self.connection.read() - self.logging.debug("got response: %s"%response) + self.logging.info("got response: %s"%response) except IOError, e: if hasattr(e, 'reason'): - self.logging.debug("failed to reach %s because of %s"%(self.mgtSvr, e.reason)) + self.logging.critical("failed to reach %s because of %s"%(self.mgtSvr, e.reason)) elif hasattr(e, 'code'): - self.logging.debug("server returned %d error code"%e.code) + self.logging.critical("server returned %d error code"%e.code) except HTTPException, h: self.logging.debug("encountered http Exception %s"%h.args) if self.retries > 0: @@ -78,9 +78,9 @@ class cloudConnection(object): requestUrl = "&".join(["=".join([request[0], urllib.quote_plus(str(request[1]))]) for request in requests]) self.connection = urllib2.urlopen("http://%s:%d/client/api?%s"%(self.mgtSvr, self.port, requestUrl)) - self.logging.debug("sending request without auth: %s"%requestUrl) + self.logging.debug("sending GET request without auth: %s"%requestUrl) response = self.connection.read() - self.logging.debug("got response: %s"%response) + self.logging.info("got response: %s"%response) return response def pollAsyncJob(self, jobId, response): @@ -136,15 +136,13 @@ class cloudConnection(object): i = i + 1 if self.logging is not None: - self.logging.debug("sending command: %s %s"%(commandName, str(requests))) + self.logging.info("sending command: %s %s"%(commandName, str(requests))) result = None if self.auth: result = self.make_request_with_auth(commandName, requests) else: result = self.make_request_without_auth(commandName, requests) - if self.logging is not None: - self.logging.debug("got result: %s"%result) if result is None: return None diff --git a/tools/testClient/deployDataCenter.py b/tools/testClient/deployDataCenter.py index e47dc726676..2d54725c412 100644 --- a/tools/testClient/deployDataCenter.py +++ b/tools/testClient/deployDataCenter.py @@ -7,9 +7,6 @@ import logging from cloudstackAPI import * from optparse import OptionParser -module_logger = "testclient.deploy" - - class deployDataCenters(): def __init__(self, cfgFile): self.configFile = cfgFile @@ -215,11 +212,11 @@ class deployDataCenters(): testClientLogger = None if testClientLogFile is not None: - testClientLogger = logging.getLogger("testclient.deploy.deployDataCenters") + testClientLogger = logging.getLogger("testclient.testengine.run") fh = logging.FileHandler(testClientLogFile) fh.setFormatter(logging.Formatter("%(asctime)s - %(levelname)s - %(name)s - %(message)s")) testClientLogger.addHandler(fh) - testClientLogger.setLevel(logging.DEBUG) + testClientLogger.setLevel(logging.INFO) self.testClientLogger = testClientLogger self.testClient = cloudstackTestClient.cloudstackTestClient(mgt.mgtSvrIp, mgt.port, mgt.apiKey, mgt.securityKey, logging=self.testClientLogger)