[fix] Changing logging to stderr for the Geonames scripts

This commit is contained in:
Al
2015-06-14 15:38:52 -04:00
parent e3dffc177c
commit 43e023077c
2 changed files with 3 additions and 3 deletions

View File

@@ -2,8 +2,8 @@ import logging
import sys
def log_to_stdout(level=logging.INFO):
handler = logging.StreamHandler(sys.stdout)
def log_to_file(f, level=logging.INFO):
handler = logging.StreamHandler(f)
formatter = logging.Formatter('%(asctime)s %(levelname)s [%(name)s]: %(message)s')
handler.setFormatter(formatter)
logging.root.addHandler(handler)