mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2025-12-15 13:44:39 +00:00
Merge pull request #152 from lixinyu1011/workstation_dev_YB3
修改减少modbus报警信息,以及websocket报警信息
This commit is contained in:
@@ -421,7 +421,8 @@ class MessageProcessor:
|
||||
ssl_context = ssl_module.create_default_context()
|
||||
|
||||
ws_logger = logging.getLogger("websockets.client")
|
||||
ws_logger.setLevel(logging.INFO)
|
||||
# ws_logger.setLevel(logging.INFO)
|
||||
ws_logger.setLevel(logging.WARNING) # 只显示警告和错误
|
||||
|
||||
async with websockets.connect(
|
||||
self.websocket_url,
|
||||
|
||||
@@ -191,8 +191,14 @@ def configure_logger(loglevel=None):
|
||||
|
||||
# 添加处理器到根日志记录器
|
||||
root_logger.addHandler(console_handler)
|
||||
logging.getLogger("asyncio").setLevel(logging.INFO)
|
||||
logging.getLogger("urllib3").setLevel(logging.INFO)
|
||||
|
||||
# 降低第三方库的日志级别,避免过多输出
|
||||
# pymodbus 库的日志太详细,设置为 WARNING
|
||||
logging.getLogger('pymodbus').setLevel(TRACE_LEVEL)
|
||||
logging.getLogger('pymodbus.logging').setLevel(TRACE_LEVEL)
|
||||
logging.getLogger('pymodbus.logging.base').setLevel(TRACE_LEVEL)
|
||||
logging.getLogger('pymodbus.logging.decoders').setLevel(TRACE_LEVEL)
|
||||
|
||||
|
||||
# 配置日志系统
|
||||
configure_logger()
|
||||
|
||||
Reference in New Issue
Block a user