From e9c6dbe6d3dafff46ae2b065ff11b9f9a5a28741 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sun, 23 Jul 2017 09:38:27 +0800 Subject: Update bin scripts to use global "CONFIGS" Also update copyright year/email and minor cleanups Signed-off-by: Aaron LI --- bin/fg21sim-download-cluster-data | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'bin/fg21sim-download-cluster-data') diff --git a/bin/fg21sim-download-cluster-data b/bin/fg21sim-download-cluster-data index a3708fd..ed49f5a 100755 --- a/bin/fg21sim-download-cluster-data +++ b/bin/fg21sim-download-cluster-data @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (c) 2016 Weitian LI +# Copyright (c) 2016-2017 Weitian LI # MIT license """ @@ -65,7 +65,7 @@ import csv import urllib.request import tarfile -from fg21sim.configs import configs +from fg21sim.configs import CONFIGS from fg21sim.utils import setup_logging @@ -96,17 +96,12 @@ def main(): help="be quiet so do not log messages to screen") args = parser.parse_args() - if args.quiet: - log_stream = "" - else: - log_stream = None - - tool = os.path.basename(sys.argv[0]) - - setup_logging(dict_config=configs.logging, + log_stream = "" if args.quiet else None + setup_logging(dict_config=CONFIGS.logging, level=args.loglevel, stream=log_stream, logfile=args.logfile) + tool = os.path.basename(sys.argv[0]) logger = logging.getLogger(tool) logger.info("COMMAND: {0}".format(" ".join(sys.argv))) -- cgit v1.2.2