From 22b2b24421cb323cba72b5d93dd83d67b49f85a9 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Fri, 23 Feb 2018 13:02:45 -0500 Subject: [PATCH] set up logging for propose-final-releases Several of the support modules now use logging exclusively as a way to emit debug info. Set up logging so we can see that debug info when --verbose is turned on. Change-Id: I029b6cc8667fca61f70afd19e99dd865870a546e Signed-off-by: Doug Hellmann --- openstack_releases/cmds/propose_final_releases.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openstack_releases/cmds/propose_final_releases.py b/openstack_releases/cmds/propose_final_releases.py index 7e4d6d2952..6745450893 100644 --- a/openstack_releases/cmds/propose_final_releases.py +++ b/openstack_releases/cmds/propose_final_releases.py @@ -16,9 +16,11 @@ from __future__ import print_function import argparse import atexit +import logging import os.path import re import shutil +import sys import tempfile import openstack_releases @@ -108,6 +110,14 @@ def main(): def verbose(msg): pass + # Set up logging, including making some loggers quiet. + logging.basicConfig( + format='%(levelname)7s: %(message)s', + stream=sys.stdout, + level=logging.DEBUG if args.verbose else logging.INFO, + ) + logging.getLogger('urllib3.connectionpool').setLevel(logging.WARNING) + deliverables_dir = args.deliverables_dir workdir = tempfile.mkdtemp(prefix='releases-')