fix: reduce MQTT log noise at INFO level (#365)

Downgrade 58 diagnostic logger.info calls to logger.debug in
bambu_mqtt.py — payload dumps, detector state changes, field
discovery, H2D disambiguation, and periodic status updates no longer
flood logs at the default INFO level. User-initiated actions (print,
stop, calibration, AMS load/unload) remain at INFO. Also suppress
paho-mqtt library INFO messages in production mode.
This commit is contained in:
maziggy
2026-02-15 09:56:51 +01:00
parent ce1b3b2741
commit e1b3329b68
7 changed files with 454 additions and 447 deletions
+2
View File
@@ -106,10 +106,12 @@ def _apply_log_level(debug: bool):
logging.getLogger("sqlalchemy.engine").setLevel(logging.INFO)
logging.getLogger("httpcore").setLevel(logging.DEBUG)
logging.getLogger("httpx").setLevel(logging.DEBUG)
logging.getLogger("paho.mqtt").setLevel(logging.DEBUG)
else:
logging.getLogger("sqlalchemy.engine").setLevel(logging.WARNING)
logging.getLogger("httpcore").setLevel(logging.WARNING)
logging.getLogger("httpx").setLevel(logging.WARNING)
logging.getLogger("paho.mqtt").setLevel(logging.WARNING)
logger.info("Log level changed to %s", "DEBUG" if debug else "INFO")