feat: suppress nornir INFO logs to reduce console verbosity

Set logging level for nornir.core and nornir loggers to WARNING in config_tools_nornir.py and display_tools_nornir.py. This prevents nornir from logging task execution at INFO level to the console, as the logging={"enabled": False} parameter in InitNornir only disables plugin internal logs.
This commit is contained in:
YueGuobin 2026-03-05 21:04:46 +08:00
parent 2485bfec46
commit 28f2fe03e6
2 changed files with 12 additions and 0 deletions

View File

@ -49,6 +49,12 @@ from gns3server.agent.gns3_copilot.utils import get_device_ports_from_topology
# config log
logger = logging.getLogger(__name__)
# Suppress nornir INFO logs in console (reduce verbosity)
# The logging={"enabled": False} in InitNornir only disables plugin internal logs,
# but nornir.core still logs task execution at INFO level. Set to WARNING to suppress these.
logging.getLogger("nornir.core").setLevel(logging.WARNING)
logging.getLogger("nornir").setLevel(logging.WARNING)
# Local Nornir configuration functions for Cisco IOS Telnet devices
def _get_nornir_defaults() -> dict[str, Any]:

View File

@ -49,6 +49,12 @@ from gns3server.agent.gns3_copilot.utils import get_device_ports_from_topology
# config log
logger = logging.getLogger(__name__)
# Suppress nornir INFO logs in console (reduce verbosity)
# The logging={"enabled": False} in InitNornir only disables plugin internal logs,
# but nornir.core still logs task execution at INFO level. Set to WARNING to suppress these.
logging.getLogger("nornir.core").setLevel(logging.WARNING)
logging.getLogger("nornir").setLevel(logging.WARNING)
# Local Nornir configuration functions for Cisco IOS Telnet devices
def _get_nornir_defaults() -> dict[str, Any]: