mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-01-10 14:58:05 +00:00
py-i2phosts-maint: use check_logger_options()
This commit is contained in:
parent
b92c03643d
commit
df47c06b0b
@ -57,14 +57,14 @@ 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
|
||||||
|
|
||||||
# configure logger
|
# configure logger
|
||||||
if args.debug == True:
|
if args.debug == True:
|
||||||
log_level = 'debug'
|
log_level = 'debug'
|
||||||
log_file = None
|
log_file = None
|
||||||
else:
|
else:
|
||||||
log_level = config['log_level']
|
log_file, log_level = check_logger_options(config)
|
||||||
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