1
1
mirror of https://github.com/KenanZhu/AutoLibrary.git synced 2026-06-18 15:33:03 +08:00

refactor(operators): 为 _showTrace 方法添加合适的 TraceLevel 参数

This commit is contained in:
2026-03-18 11:02:52 +08:00
parent ec683cf154
commit 160d6a2428
11 changed files with 109 additions and 66 deletions
+22
View File
@@ -32,6 +32,18 @@ class MsgBase:
implement queue polling to retrieve and process messages.
"""
class TraceLevel:
"""
Enum class for trace levels.
This class provides the trace levels for the logger.
"""
DEBUG = logging.DEBUG
INFO = logging.INFO
WARNING = logging.WARNING
ERROR = logging.ERROR
CRITICAL = logging.CRITICAL
def __init__(
self,
input_queue: queue.Queue,
@@ -67,6 +79,16 @@ class MsgBase:
self._logger.log(level, msg)
def _showLog(
self,
msg: str,
level: int = logging.INFO
):
if self._logger:
self._logger.log(level, msg)
def _waitMsg(
self,
timeout: float = 1.0