24 lines
759 B
Python
24 lines
759 B
Python
|
|
import logging
|
||
|
|
from logging.handlers import TimedRotatingFileHandler
|
||
|
|
|
||
|
|
from flask import Flask, request, jsonify
|
||
|
|
from app.cross_evaluate_worker import *
|
||
|
|
from app.cross_eva_views import *
|
||
|
|
|
||
|
|
|
||
|
|
def init_log():
|
||
|
|
# 创建一个按日期拆分的日志处理程序
|
||
|
|
logpath = 'log/cross_doctor.log'
|
||
|
|
tr_handler = TimedRotatingFileHandler(logpath, when='midnight', interval=1, backupCount=14)
|
||
|
|
logging.basicConfig(level=logging.DEBUG, encoding='utf-8',
|
||
|
|
format='%(asctime)s %(levelname)s %(message)s',
|
||
|
|
handlers=[tr_handler])
|
||
|
|
|
||
|
|
|
||
|
|
if __name__ == '__main__':
|
||
|
|
init_log()
|
||
|
|
init_with_config()
|
||
|
|
host = g_config['host']
|
||
|
|
port = g_config['port']
|
||
|
|
app.run(threaded=True, debug=False, host=host, port=port)
|