Skip to content
Snippets Groups Projects
Commit 31b22aed authored by KERDREUX Jerome's avatar KERDREUX Jerome
Browse files

Fix slog

parent 68bd7fd5
No related branches found
No related tags found
No related merge requests found
......@@ -190,11 +190,10 @@ func mqttSetup(mqttBroker string, port int) MQTT.Client {
SetDefaultPublishHandler(mqttPublishHander).SetAutoReconnect(true)
client := MQTT.NewClient(opts)
slog.Debug("Connected to ", "client", client)
if token := client.Connect(); token.Wait() && token.Error() != nil {
panic(token.Error())
}
slog.Debug("Connected to", "Broker", mqttBroker, "Port", port, "Client", mqttClientID)
if token := client.Subscribe(mqttTopic+"/#", 0, nil); token.Wait() && token.Error() != nil {
panic(token.Error())
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment