import datetime

from unitls.LogerinTxt import app_logger
from .flightDB import flightDB


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