From 74ddd135ebc63399d9f71b585f23ae8b97d46866 Mon Sep 17 00:00:00 2001 From: xengineering Date: Mon, 23 Mar 2026 20:46:34 +0100 Subject: Add MQTTMessage.String() This simplifies debugging. --- mqtt.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mqtt.go') diff --git a/mqtt.go b/mqtt.go index a7b374d..d9f0632 100644 --- a/mqtt.go +++ b/mqtt.go @@ -25,6 +25,10 @@ type MQTTMessage struct { Payload []byte } +func (m MQTTMessage) String() string { + return fmt.Sprintf("topic='%s' message='%s'", m.Topic, string(m.Payload)) +} + func MQTTRun(config MQTTConfig, tx chan MQTTMessage) { mqttServerHealthTopic = fmt.Sprintf("%s/server/health", config.TopicPrefix) -- cgit v1.3