Commit 7484164b authored by ibuler's avatar ibuler

[Update] 修改运行方式

parent 2999b17e
......@@ -44,7 +44,6 @@ class Coco:
self.replay_recorder_class = None
self.command_recorder_class = None
self._task_handler = None
self.config = config
init_app(self)
@property
......@@ -66,7 +65,7 @@ class Coco:
return self._task_handler
def make_logger(self):
create_logger(self)
create_logger()
@staticmethod
def load_extra_conf_from_server():
......
......@@ -5,11 +5,12 @@
import os
import logging
from logging.config import dictConfig
from .config import config as app_config
def create_logger(app):
level = app.config['LOG_LEVEL']
log_dir = app.config.get('LOG_DIR')
def create_logger():
level = app_config['LOG_LEVEL']
log_dir = app_config.get('LOG_DIR')
log_path = os.path.join(log_dir, 'coco.log')
main_setting = {
'handlers': ['console', 'file'],
......
......@@ -28,7 +28,6 @@ DAEMON = False
PID_FILE = os.path.join(BASE_DIR, 'coco.pid')
coco = Coco()
coco.config.from_object(config)
def check_pid(pid):
......
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