mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-04-20 19:12:13 +02:00
replace Serial.print with logger
This commit is contained in:
parent
f38dcea1f1
commit
a220b9ecc2
13 changed files with 397 additions and 562 deletions
|
|
@ -1,4 +1,7 @@
|
|||
#include "WResp.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
static const char *TAG = "WResp";
|
||||
void JsonSockEvent::beginEvent(AsyncWebSocket *server, const char *evt, char *buff, size_t buffSize) {
|
||||
this->server = server;
|
||||
this->buff = buff;
|
||||
|
|
@ -24,8 +27,7 @@ void JsonSockEvent::_safecat(const char *val, bool escape) {
|
|||
size_t len = (escape ? this->calcEscapedLength(val) : strlen(val)) + strlen(this->buff);
|
||||
if(escape) len += 2;
|
||||
if(len >= this->buffSize) {
|
||||
Serial.printf("Socket exceeded buffer size %d - %d\n", this->buffSize, len);
|
||||
Serial.println(this->buff);
|
||||
ESP_LOGE(TAG, "Socket exceeded buffer size %d - %d: %s", this->buffSize, len, this->buff);
|
||||
return;
|
||||
}
|
||||
if(escape) strcat(this->buff, "\"");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue