mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-01-09 06:18:05 +00:00
py-i2phosts-maint: stop using check_logger_options()
This commit is contained in:
parent
389194b66d
commit
2b898422f1
@ -20,6 +20,8 @@ args = parser.parse_args()
|
|||||||
|
|
||||||
# read config
|
# read config
|
||||||
spec = '''
|
spec = '''
|
||||||
|
log_file = string(default='/var/log/py-i2phosts/maintainer.log')
|
||||||
|
log_level = option('debug', 'info', 'warning', 'error', 'critical', default='info')
|
||||||
external_inactive_max = integer(default=365)
|
external_inactive_max = integer(default=365)
|
||||||
internal_inactive_max = integer(default=14)
|
internal_inactive_max = integer(default=14)
|
||||||
external_expires = integer(default=30)
|
external_expires = integer(default=30)
|
||||||
@ -43,7 +45,6 @@ sys.path.insert(1, DJANGO_PROJECT_PATH)
|
|||||||
os.environ['DJANGO_SETTINGS_MODULE'] = DJANGO_SETTINGS_MODULE
|
os.environ['DJANGO_SETTINGS_MODULE'] = DJANGO_SETTINGS_MODULE
|
||||||
from web.postkey.models import i2phost
|
from web.postkey.models import i2phost
|
||||||
from web.lib.utils import get_logger
|
from web.lib.utils import get_logger
|
||||||
from web.lib.utils import check_logger_options
|
|
||||||
from web.lib.utils import validate_config
|
from web.lib.utils import validate_config
|
||||||
|
|
||||||
# validate config
|
# validate config
|
||||||
@ -54,7 +55,8 @@ if args.debug == True:
|
|||||||
log_level = 'debug'
|
log_level = 'debug'
|
||||||
log_file = None
|
log_file = None
|
||||||
else:
|
else:
|
||||||
log_file, log_level = check_logger_options(config)
|
log_level = config['log_level']
|
||||||
|
log_file = config['log_file']
|
||||||
log = get_logger(filename=log_file, log_level=log_level)
|
log = get_logger(filename=log_file, log_level=log_level)
|
||||||
|
|
||||||
all_hosts = i2phost.objects.all()
|
all_hosts = i2phost.objects.all()
|
||||||
|
Loading…
Reference in New Issue
Block a user