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

This commit is contained in:
Erik Montnemery 2021-01-23 20:52:43 +01:00 committed by GitHub
parent eb339b9793
commit 0e068a5f39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

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,