This commit is contained in:
2026-06-08 17:52:53 +08:00
parent 9654b79cec
commit 49a84e80e1
4 changed files with 91 additions and 47 deletions

View File

@@ -65,8 +65,8 @@ class LoggerManager:
backup_count = config.LOG_BACKUP_COUNT
try:
# 创建日志队列(界队列)
self._log_queue = queue.Queue(-1)
# 创建日志队列(界队列,防止内存泄漏;满时自动丢弃旧日志
self._log_queue = queue.Queue(maxsize=config.LOG_QUEUE_MAXSIZE)
# 确保日志文件所在的目录存在
log_dir = os.path.dirname(log_file)