fix: 不缓存ListControl每轮重查+灭comtypes洪水+4策略全路径日志

This commit is contained in:
youpaishidifu
2026-07-24 21:18:23 +08:00
parent 73e22e5066
commit c129edac6d
2 changed files with 135 additions and 170 deletions
+7
View File
@@ -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")