From 47d01dbd3d062595956d6d43fd6fe75b4b4dcd69 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 fb6d58eba22..12b004b7f26 100644 --- a/tools/testClient/cloudstackConnection.py +++ b/tools/testClient/cloudstackConnection.py @@ -51,14 +51,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: @@ -77,9 +77,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): @@ -135,15 +135,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 18684b37621..ae2797c0608 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): @@ -316,11 +313,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 = \