#!/usr/bin/env python # -*- encoding: utf-8 -*- import time from conf.conf import conf from loguru import logger def info_PRINT(messges): timestap = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) day = time.strftime("%Y-%m-%d", time.localtime()) logger.info(messges) with open(file=conf.logPath + str(day) + ".log", mode="a+", encoding="utf-8") as f: f.write(str(timestap) + " | INFO | " + str(messges) + "\n") f.close() def warning_PRINT(messges): timestap = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) day = time.strftime("%Y-%m-%d", time.localtime()) logger.warning(messges) with open(file=conf.logPath + str(day) + ".log", mode="a+", encoding="utf-8") as f: f.write(str(timestap) + " | WARNING | " + str(messges) + "\n") f.close() def error_PRINT(messges): timestap = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) day = time.strftime("%Y-%m-%d", time.localtime()) logger.error(messges) with open(file=conf.logPath + str(day) + ".log", mode="a+", encoding="utf-8") as f: f.write(str(timestap) + " | ERROR | " + str(messges) + "\n") f.close()
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)