fix: 不缓存ListControl每轮重查+灭comtypes洪水+4策略全路径日志
This commit is contained in:
@@ -18,6 +18,13 @@ logging.basicConfig(
|
||||
_fh = logging.FileHandler("msgbot.log", encoding="utf-8", mode="w")
|
||||
_fh.setLevel(logging.DEBUG)
|
||||
_fh.setFormatter(logging.Formatter("%(asctime)s [%(name)s] %(levelname)s: %(message)s"))
|
||||
|
||||
# 过滤 comtypes 的 DEBUG 洪流
|
||||
class ComtypesFilter(logging.Filter):
|
||||
def filter(self, record):
|
||||
return not record.name.startswith("comtypes") or record.levelno >= logging.WARNING
|
||||
|
||||
_fh.addFilter(ComtypesFilter())
|
||||
logging.getLogger().addHandler(_fh)
|
||||
|
||||
logger = logging.getLogger("msgbot")
|
||||
|
||||
Reference in New Issue
Block a user