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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user