From: Dan Mick Date: Fri, 12 Jun 2015 21:26:36 +0000 (-0700) Subject: Silence urllib3 logging whether it's bundled in requests or not X-Git-Tag: 1.1.0~910^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F522%2Fhead;p=teuthology.git Silence urllib3 logging whether it's bundled in requests or not Also, do it only in teuthology/__init__.py Signed-off-by: Dan Mick --- diff --git a/teuthology/__init__.py b/teuthology/__init__.py index 8144418c8..d0bcfc0ab 100644 --- a/teuthology/__init__.py +++ b/teuthology/__init__.py @@ -21,6 +21,9 @@ if os.path.split(exec_dir)[-1] == 'bin' and exec_dir not in os.environ['PATH']: # We don't need to see log entries for each connection opened logging.getLogger('requests.packages.urllib3.connectionpool').setLevel( logging.WARN) +# if requests doesn't bundle it, shut it up anyway +logging.getLogger('urllib3.connectionpool').setLevel( + logging.WARN) logging.basicConfig( level=logging.INFO, diff --git a/teuthology/lock.py b/teuthology/lock.py index 0d100981a..9b5796669 100644 --- a/teuthology/lock.py +++ b/teuthology/lock.py @@ -16,9 +16,6 @@ from .config import config from .lockstatus import get_status log = logging.getLogger(__name__) -# Don't need to see connection pool INFO messages -logging.getLogger("requests.packages.urllib3.connectionpool").setLevel( - logging.WARNING) is_vpm = lambda name: 'vpm' in name diff --git a/teuthology/report.py b/teuthology/report.py index 48fed5cab..e56d1422f 100644 --- a/teuthology/report.py +++ b/teuthology/report.py @@ -20,10 +20,6 @@ def init_logging(): :returns: a logger """ - # Don't need to see connection pool INFO messages - logging.getLogger("requests.packages.urllib3.connectionpool").setLevel( - logging.WARNING) - log = logging.getLogger(__name__) return log