1
0
mirror of https://github.com/r4sas/py-i2phosts synced 2025-01-22 20:44:55 +00:00

py-i2phosts-checker: use check_logger_options()

This commit is contained in:
Hidden Z 2010-10-31 19:50:52 +00:00
parent 891472cfac
commit 4c99772834

View File

@ -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