mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-19 07:33:18 +02:00
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:
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user