Commit 87dea073 authored by ibuler's avatar ibuler

[Update] 修改log文件名字

parent 7e31f542
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# #
import os import os
import socket
import logging import logging
from logging.config import dictConfig from logging.config import dictConfig
from .conf import config as app_config from .conf import config as app_config
...@@ -11,9 +12,10 @@ from .conf import config as app_config ...@@ -11,9 +12,10 @@ from .conf import config as app_config
def create_logger(): def create_logger():
level = app_config['LOG_LEVEL'] level = app_config['LOG_LEVEL']
log_dir = app_config['LOG_DIR'] log_dir = app_config['LOG_DIR']
filename = '{}.log'.format(socket.gethostname())
if not os.path.isdir(log_dir): if not os.path.isdir(log_dir):
os.makedirs(log_dir) os.makedirs(log_dir)
log_path = os.path.join(log_dir, 'coco.log') log_path = os.path.join(log_dir, filename)
main_setting = { main_setting = {
'handlers': ['console', 'file'], 'handlers': ['console', 'file'],
'level': level, 'level': level,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment