from logging.handlers import RotatingFileHandler
def __init__(self, filename):
self.filename = filename + ".log"
self.LOG_FORMAT = "%(asctime)s - %(levelname)s - %(message)s"
self.DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
rfh = RotatingFileHandler(
datefmt=self.DATE_FORMAT,
level=logging.INFO, # 日志最低严重级别
if __name__ == "__main__":