From 4c9977283453e8d167444d0e856e5f176aa14c5a Mon Sep 17 00:00:00 2001 From: Hidden Z Date: Sun, 31 Oct 2010 19:50:52 +0000 Subject: [PATCH] py-i2phosts-checker: use check_logger_options() --- py-i2phosts-checker | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/py-i2phosts-checker b/py-i2phosts-checker index ca05676..7685bb6 100755 --- a/py-i2phosts-checker +++ b/py-i2phosts-checker @@ -84,6 +84,7 @@ 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 +from web.lib.utils import check_logger_options # configure logger if args.debug == True: @@ -93,16 +94,7 @@ elif args.verbose == True: log_level = 'info' log_file = None else: - if 'log_level' in config: - log_level = config['log_level'] - else: - sys.stderr.write('"log_level" missing in config\n') - sys.exit(1) - if 'log_file' in config: - log_file = config['log_file'] - else: - sys.stderr.write('"log_file missing in config\n') - sys.exit(1) + log_file, log_level = check_logger_options(config) if not args.debug and not args.verbose: # get pid object for daemon