From 59254857adc2d1d4edcac0c4ac0efa80678b2d9d Mon Sep 17 00:00:00 2001 From: Hidden Z Date: Fri, 29 Oct 2010 20:54:21 +0000 Subject: [PATCH] py-i2phosts-checker: configure logger using get_logger() --- py-i2phosts-checker | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/py-i2phosts-checker b/py-i2phosts-checker index 9691bb7..8a44f92 100755 --- a/py-i2phosts-checker +++ b/py-i2phosts-checker @@ -37,15 +37,16 @@ else: sys.path.insert(1, DJANGO_PROJECT_PATH) os.environ['DJANGO_SETTINGS_MODULE'] = DJANGO_SETTINGS_MODULE from web.postkey.models import i2phost +from web.lib.utils import get_logger # configure logger -log = logging.getLogger(sys.argv[0]) -handler = logging.StreamHandler() -log.addHandler(handler) -if args.debug: - log.setLevel(logging.DEBUG) +if args.debug == True: + log_level = 'debug' + log_file = None else: - log.setLevel(logging.INFO) + log_level = config['log_level'] + log_file = config['log_file'] +log = get_logger(log_level=log_level) all_hosts = i2phost.objects.all()