You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2015/01/28 05:37:24 UTC

[46/50] trafficserver-qa git commit: Cleanup logging

Cleanup logging


Project: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/commit/015ef82f
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/tree/015ef82f
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/diff/015ef82f

Branch: refs/heads/master
Commit: 015ef82f06b179ca85c4f018140243a0da57edf8
Parents: b7fd08b
Author: Thomas Jackson <ja...@gmail.com>
Authored: Fri Jan 23 15:08:51 2015 -0800
Committer: Thomas Jackson <ja...@gmail.com>
Committed: Fri Jan 23 15:08:51 2015 -0800

----------------------------------------------------------------------
 tsqa/environment.py | 15 ++++++---------
 tsqa/utils.py       |  1 +
 2 files changed, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver-qa/blob/015ef82f/tsqa/environment.py
----------------------------------------------------------------------
diff --git a/tsqa/environment.py b/tsqa/environment.py
index 70300ee..c1eafd6 100644
--- a/tsqa/environment.py
+++ b/tsqa/environment.py
@@ -31,7 +31,6 @@ class EnvironmentFactory(object):
 
         # TODO: ensure this directory exists? (and is git?)
         self.source_dir = source_dir
-        self.log = logging.getLogger(__name__)
         self.env_cache_dir = env_cache_dir  # base directory for environment caching
 
         if default_configure is not None:
@@ -55,7 +54,7 @@ class EnvironmentFactory(object):
             'stderr': subprocess.PIPE
         }
 
-        if self.log.isEnabledFor(logging.DEBUG):
+        if log.isEnabledFor(logging.DEBUG):
             kwargs['stdout'] = sys.stdout.fileno()
             kwargs['stderr'] = sys.stderr.fileno()
 
@@ -124,7 +123,7 @@ class EnvironmentFactory(object):
             env_key[whitelisted_key] = env.get(whitelisted_key)
 
         key = self._get_key(configure, env_key)
-        self.log.debug('Key is: %s, args are: %s %s' % (key, configure, env_key))
+        log.debug('Key is: %s, args are: %s %s' % (key, configure, env_key))
 
         # if we don't have it built already, lets build it
         if key not in self.environment_stash:
@@ -138,7 +137,7 @@ class EnvironmentFactory(object):
                 'stderr': subprocess.PIPE
             }
 
-            if self.log.isEnabledFor(logging.DEBUG):
+            if log.isEnabledFor(logging.DEBUG):
                 kwargs['stdout'] = sys.stdout.fileno()
                 kwargs['stderr'] = sys.stderr.fileno()
 
@@ -191,7 +190,6 @@ class Layout:
 
     def __init__(self, prefix):
         self.prefix = prefix
-        self.log = logging.getLogger(__name__)
 
     def __getattr__(self, name):
         # Raise an error for suffixes we don't know about
@@ -262,7 +260,6 @@ class Environment:
         """
         Initialize a new Environment.
         """
-        self.log = logging.getLogger(__name__)
         self.cop = None
         # TODO: parse config? Don't like the separate hostports...
         self.hostports = []
@@ -378,15 +375,15 @@ class Environment:
     def start(self):
         if self.running():  # if its already running, don't start another one
             raise Exception('traffic cop already started')
-        self.log.debug("Starting traffic cop")
+        log.debug("Starting traffic cop")
         assert(os.path.isfile(os.path.join(self.layout.sysconfdir, 'records.config')))
         self.__exec_cop()
-        self.log.debug("Started traffic cop: %s", self.cop)
+        log.debug("Started traffic cop: %s", self.cop)
 
     # TODO: exception if already stopped?
     # TODO: more graceful stop?
     def stop(self):
-        self.log.debug("Killing traffic cop: %s", self.cop)
+        log.debug("Killing traffic cop: %s", self.cop)
         if self.cop is not None:
             self.cop.kill()
             self.cop.terminate()  # TODO: remove?? or wait...

http://git-wip-us.apache.org/repos/asf/trafficserver-qa/blob/015ef82f/tsqa/utils.py
----------------------------------------------------------------------
diff --git a/tsqa/utils.py b/tsqa/utils.py
index 28f9e45..1878738 100644
--- a/tsqa/utils.py
+++ b/tsqa/utils.py
@@ -6,6 +6,7 @@ import subprocess
 import socket
 import time
 
+import tsqa.log
 import logging
 
 log = logging.getLogger(__name__)