Merge pull request #1161 from Phat3/fix/log_mem_exhaustion

Fix memory exhaustion problem caused by the logger
This commit is contained in:
kj.xwings.l
2022-05-27 15:02:07 +08:00
committed by GitHub
+2 -1
View File
@@ -7,6 +7,7 @@ import copy
import logging
import os
import re
import weakref
from typing import Optional, TextIO
@@ -38,7 +39,7 @@ class QlBaseFormatter(logging.Formatter):
def __init__(self, ql, *args, **kwargs):
super().__init__(*args, **kwargs)
self.ql = ql
self.ql = weakref.proxy(ql)
def get_level_tag(self, level: str) -> str:
return self.__level_tag[level]