From 40765e3dbad79be8209186a44ae692eeffd84f52 Mon Sep 17 00:00:00 2001 From: "Ryan P. Kelly" Date: Fri, 4 Mar 2016 12:09:45 -0500 Subject: [PATCH] and use the logger we requested instead of logging on the root --- tzwhere/tzwhere.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tzwhere/tzwhere.py b/tzwhere/tzwhere.py index 8bb0259..dfdf567 100755 --- a/tzwhere/tzwhere.py +++ b/tzwhere/tzwhere.py @@ -259,7 +259,7 @@ def read_tzworld(input_kind='json', path=None): def read_json(path=None): if path is None: path = tzwhere.DEFAULT_JSON - logging.info('Reading json input file: %s\n' % path) + LOGGER.info('Reading json input file: %s\n' % path) with open(path, 'r') as f: featureCollection = json.load(f) return featureCollection @@ -268,14 +268,14 @@ def read_json(path=None): def read_pickle(path=None): if path is None: path = tzwhere.DEFAULT_PICKLE - logging.info('Reading pickle input file: %s\n' % path) + LOGGER.info('Reading pickle input file: %s\n' % path) with open(path, 'rb') as f: featureCollection = pickle.load(f) return featureCollection @staticmethod def write_pickle(featureCollection, path=DEFAULT_PICKLE): - logging.info('Writing pickle output file: %s\n' % path) + LOGGER.info('Writing pickle output file: %s\n' % path) with open(path, 'wb') as f: pickle.dump(featureCollection, f, protocol=2) @@ -283,7 +283,7 @@ def write_pickle(featureCollection, path=DEFAULT_PICKLE): def _read_polygons_from_csv(path=None): if path is None: path = tzwhere.DEFAULT_CSV - logging.info('Reading from CSV input file: %s\n' % path) + LOGGER.info('Reading from CSV input file: %s\n' % path) with open(path, 'r') as f: for row in f: row = row.split(',') @@ -291,7 +291,7 @@ def _read_polygons_from_csv(path=None): @staticmethod def write_csv(featureCollection, path=DEFAULT_CSV): - logging.info('Writing csv output file: %s\n' % path) + LOGGER.info('Writing csv output file: %s\n' % path) with open(path, 'w') as f: writer = csv.writer(f) for (tzname, polygon) in tzwhere._feature_collection_polygons( @@ -366,7 +366,7 @@ def main(): import sys sys.exit(1) - logging.info('Application started..') + LOGGER.info('Application started..') args = docopt.docopt(HELP) global report_memory