memory optimization

This commit is contained in:
Yurii
2023-11-22 21:00:19 +03:00
parent 227060591f
commit 18acf059fc

View File

@@ -629,17 +629,20 @@ protected:
} }
if (settings.debug) { if (settings.debug) {
String payloadStr; Log.strace("MQTT.MSG", "Topic: %s\r\n> ", topic);
payloadStr.reserve(length);
for (unsigned int i = 0; i < length; i++) { for (unsigned int i = 0; i < length; i++) {
if ( payload[i] == 10 ) { if ( payload[i] == 10 ) {
payloadStr += "\r\n> "; Log.print("\r\n> ");
} else { } else {
payloadStr += (char) payload[i]; Log.print((char) payload[i]);
} }
} }
Log.print("\r\n\n");
Log.strace("MQTT.MSG", "Topic: %s\r\n> %s\n\r\n", topic, payloadStr.c_str()); for (Stream* stream : Log.getStreams()) {
stream->flush();
}
} }
StaticJsonDocument<2048> doc; StaticJsonDocument<2048> doc;