From 253c9462a385f4c1df99ee6b03e503d1383887b0 Mon Sep 17 00:00:00 2001 From: jerryliang Date: Wed, 22 Feb 2023 15:51:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E5=86=8D=E4=BD=BF=E7=94=A8LOG.py?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=20log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- work/log.py | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 work/log.py diff --git a/work/log.py b/work/log.py deleted file mode 100644 index 4ab1e9c..0000000 --- a/work/log.py +++ /dev/null @@ -1,21 +0,0 @@ -import logging -import os - - -class mylog: - def __init__(self): - self.logpath = os.path.join(os.getcwd(), "log.log") - logging.basicConfig( - level=logging.WARNING, # 级别:CRITICAL > ERROR > WARNING > INFO > DEBUG,默认级别为 WARNING - format="%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s: %(message)s", - datefmt="%Y-%m-%d %H:%M:%S", - filename=self.logFile, - filemode="a", - ) - - def write_logger(self, content): - logging.debug(content) - # 可以写其他的函数,使用其他级别的log - - def error_logger(self, content): - logging.error(content)