Truncate MQTT payload in debug messages to 8kB (#45465)

This commit is contained in:
Erik Montnemery
2021-01-23 14:52:43 -05:00
committed by GitHub
parent eb339b9793
commit 0e068a5f39
+2 -2
View File
@@ -865,7 +865,7 @@ class MQTT:
"Received message on %s%s: %s",
msg.topic,
" (retained)" if msg.retain else "",
msg.payload,
msg.payload[0:8192],
)
timestamp = dt_util.utcnow()
@@ -880,7 +880,7 @@ class MQTT:
except (AttributeError, UnicodeDecodeError):
_LOGGER.warning(
"Can't decode payload %s on %s with encoding %s (for %s)",
msg.payload,
msg.payload[0:8192],
msg.topic,
subscription.encoding,
subscription.job,