19 lines
618 B
Python
19 lines
618 B
Python
import logging
|
|
from logging.handlers import TimedRotatingFileHandler
|
|
from flask import Flask, request, jsonify
|
|
|
|
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])
|
|
|
|
|
|
init_log()
|
|
init_with_config()
|
|
if __name__ == '__main__':
|
|
app.run(threaded=True) |