Skip to content

Commit 81b3d5c

Browse files
MQTT log fix
1 parent 1584fd8 commit 81b3d5c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

EmbUI/mqtt.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void EmbUI::mqtt_reconnect(){
145145
}
146146

147147
void EmbUI::onMqttDisconnect(AsyncMqttClientDisconnectReason reason) {
148-
Serial.println(F("Disconnected from MQTT."));
148+
LOG(println,F("UI: Disconnected from MQTT."));
149149
embui.sysData.mqtt_connect = false;
150150
embui.sysData.mqtt_connected = false;
151151
}
@@ -157,15 +157,15 @@ void EmbUI::_onMqttConnect(bool sessionPresent) {
157157
void EmbUI::onMqttConnect(){
158158
sysData.mqtt_connect = false;
159159
sysData.mqtt_connected = true;
160-
Serial.println(F("Connected to MQTT."));
160+
LOG(println,F("UI: Connected to MQTT."));
161161
if(sysData.mqtt_remotecontrol){
162162
subscribeAll();
163163
}
164164
}
165165

166166
void EmbUI::onMqttMessage(char* topic, char* payload, AsyncMqttClientMessageProperties properties, size_t len, size_t index, size_t total) {
167-
LOG(print, F("Publish received: "));
168-
Serial.println(topic);
167+
LOG(print, F("UI: Publish received: "));
168+
LOG(println, topic);
169169

170170
char buffer[len + 2];
171171
memset(buffer, 0, sizeof(buffer));
@@ -201,10 +201,10 @@ void EmbUI::subscribeAll(bool isOnlyGetSet){
201201
if(isOnlyGetSet){
202202
mqttClient.subscribe(id(F("embui/set/#")).c_str(), 0);
203203
mqttClient.subscribe(id(F("embui/get/#")).c_str(), 0);
204-
LOG(println, F("Subscribe embui/get/# & embui/set/#"));
204+
LOG(println, F("UI: Subscribe embui/get/# & embui/set/#"));
205205
} else {
206206
mqttClient.subscribe(id(F("embui/#")).c_str(), 0);
207-
LOG(println, F("Subscribe All (embui/#)"));
207+
LOG(println, F("UI: Subscribe All (embui/#)"));
208208
}
209209
}
210210

0 commit comments

Comments
 (0)