import datetime

from unitls.LogerinTxt import app_logger
from .flightDB import flightDB


def insertLogs(database:flightDB,TEXT:str,user:str,time):
    try:
        now = datetime.datetime.now()
        newdic = {"航班编号": "人工%s" % user, "警告信息":TEXT, "信息状态": "",
                  "提示信息": time,"产生时间": "%s" % now, "处理人": "", "处理时间": "", "变更字段": "人工待办","显示对象":"","提示内容":""}   #需要确定显示对象，可以考虑传参
        database.insertData("logs", newdic)
    except Exception as e:
        app_logger.log_error(e)