Cleanup scripter logging

This commit is contained in:
Theo Arends 2023-07-01 14:04:27 +02:00
parent 3edb5bb096
commit 6dd8aabeef
1 changed files with 49 additions and 49 deletions

View File

@ -721,7 +721,7 @@ char *script;
maxsvars = 1; maxsvars = 1;
} }
uint16_t maxvars = maxsvars + maxnvars; uint16_t maxvars = maxsvars + maxnvars;
//AddLog(LOG_LEVEL_INFO, PSTR("Script: svar = %d, nvars = %d"), maxsvars, maxnvars); //AddLog(LOG_LEVEL_INFO, PSTR("SCR: svar = %d, nvars = %d"), maxsvars, maxnvars);
// scan lines for >DEF // scan lines for >DEF
uint16_t lines = 0; uint16_t lines = 0;
@ -1090,7 +1090,7 @@ char *script;
} }
// variables usage info // variables usage info
AddLog(LOG_LEVEL_INFO, PSTR("Script: nv=%d, tv=%d, vns=%d, vmem=%d, smem=%d"), nvars, svars, index, glob_script_mem.script_mem_size, glob_script_mem.script_size); AddLog(LOG_LEVEL_INFO, PSTR("SCR: nv=%d, tv=%d, vns=%d, vmem=%d, smem=%d"), nvars, svars, index, glob_script_mem.script_mem_size, glob_script_mem.script_size);
// copy string variables // copy string variables
char *cp1 = glob_script_mem.glob_snp; char *cp1 = glob_script_mem.glob_snp;
@ -1239,12 +1239,12 @@ void Script_Init_UDP() {
#ifdef SCRIPT_DEBUG_UDP #ifdef SCRIPT_DEBUG_UDP
AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UPNP "SCRIPT UDP started")); AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UPNP "SCR: UDP started"));
#endif #endif
glob_script_mem.udp_flags.udp_connected = 1; glob_script_mem.udp_flags.udp_connected = 1;
} else { } else {
#ifdef SCRIPT_DEBUG_UDP #ifdef SCRIPT_DEBUG_UDP
AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UPNP "SCRIPT UDP failed")); AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UPNP "SCR: UDP failed"));
#endif #endif
glob_script_mem.udp_flags.udp_connected = 0; glob_script_mem.udp_flags.udp_connected = 0;
} }
@ -1287,12 +1287,12 @@ void Script_PollUdp(void) {
uint32_t res = match_vars(vnam, &fp, &sp, &index); uint32_t res = match_vars(vnam, &fp, &sp, &index);
if (res == NUM_RES) { if (res == NUM_RES) {
#ifdef SCRIPT_DEBUG_UDP #ifdef SCRIPT_DEBUG_UDP
AddLog(LOG_LEVEL_DEBUG, PSTR("num var found - %s - %d - %d"), vnam, res, index); AddLog(LOG_LEVEL_DEBUG, PSTR("SCR: num var found - %s - %d - %d"), vnam, res, index);
#endif #endif
*fp=CharToFloat(cp + 1); *fp=CharToFloat(cp + 1);
} else if (res == STR_RES) { } else if (res == STR_RES) {
#ifdef SCRIPT_DEBUG_UDP #ifdef SCRIPT_DEBUG_UDP
AddLog(LOG_LEVEL_DEBUG, PSTR("string var found - %s - %d - %d"), vnam, res, index); AddLog(LOG_LEVEL_DEBUG, PSTR("SCR: string var found - %s - %d - %d"), vnam, res, index);
#endif #endif
strlcpy(sp, cp + 1, SCRIPT_MAXSSIZE); strlcpy(sp, cp + 1, SCRIPT_MAXSSIZE);
} else { } else {
@ -1330,12 +1330,12 @@ void script_udp_sendvar(char *vname, TS_FLOAT *fp, char *sp) {
dtostrfd(*fp, 8, flstr); dtostrfd(*fp, 8, flstr);
strcat(sbuf, flstr); strcat(sbuf, flstr);
#ifdef SCRIPT_DEBUG_UDP #ifdef SCRIPT_DEBUG_UDP
AddLog(LOG_LEVEL_DEBUG, PSTR("num var updated - %s"), sbuf); AddLog(LOG_LEVEL_DEBUG, PSTR("SCR: num var updated - %s"), sbuf);
#endif #endif
} else { } else {
strcat(sbuf, sp); strcat(sbuf, sp);
#ifdef SCRIPT_DEBUG_UDP #ifdef SCRIPT_DEBUG_UDP
AddLog(LOG_LEVEL_DEBUG, PSTR("string var updated - %s"), sbuf); AddLog(LOG_LEVEL_DEBUG, PSTR("SCR: string var updated - %s"), sbuf);
#endif #endif
} }
glob_script_mem.Script_PortUdp.beginPacket(IPAddress(239, 255, 255, 250), SCRIPT_UDP_PORT); glob_script_mem.Script_PortUdp.beginPacket(IPAddress(239, 255, 255, 250), SCRIPT_UDP_PORT);
@ -2177,7 +2177,7 @@ int32_t fetch_jpg(uint32_t sel, char *url, uint32_t xp, uint32_t yp, uint32_t sc
strcpy(jpg_task.boundary,cp + 1); strcpy(jpg_task.boundary,cp + 1);
} }
} else { } else {
AddLog(LOG_LEVEL_INFO,PSTR("HTTP error %d = %s"), httpCode, jpg_task.http.errorToString(httpCode).c_str()); AddLog(LOG_LEVEL_INFO,PSTR("SCR: HTTP error %d = %s"), httpCode, jpg_task.http.errorToString(httpCode).c_str());
} }
return httpCode; return httpCode;
break; break;
@ -3243,7 +3243,7 @@ extern void W8960_SetGain(uint8_t sel, uint16_t value);
if (!glob_script_mem.file_flags[cnt].is_open) { if (!glob_script_mem.file_flags[cnt].is_open) {
if (mode == 0) { if (mode == 0) {
#ifdef DEBUG_FS #ifdef DEBUG_FS
AddLog(LOG_LEVEL_INFO, PSTR("open file for read %d"), cnt); AddLog(LOG_LEVEL_INFO, PSTR("SCR: open file for read %d"), cnt);
#endif #endif
glob_script_mem.files[cnt] = ufsp->open(str, FS_FILE_READ); glob_script_mem.files[cnt] = ufsp->open(str, FS_FILE_READ);
if (glob_script_mem.files[cnt].isDirectory()) { if (glob_script_mem.files[cnt].isDirectory()) {
@ -3257,12 +3257,12 @@ extern void W8960_SetGain(uint8_t sel, uint16_t value);
if (mode == 1) { if (mode == 1) {
glob_script_mem.files[cnt] = ufsp->open(str,FS_FILE_WRITE); glob_script_mem.files[cnt] = ufsp->open(str,FS_FILE_WRITE);
#ifdef DEBUG_FS #ifdef DEBUG_FS
AddLog(LOG_LEVEL_INFO, PSTR("open file for write %d"), cnt); AddLog(LOG_LEVEL_INFO, PSTR("SCR: open file for write %d"), cnt);
#endif #endif
} else { } else {
glob_script_mem.files[cnt] = ufsp->open(str,FS_FILE_APPEND); glob_script_mem.files[cnt] = ufsp->open(str,FS_FILE_APPEND);
#ifdef DEBUG_FS #ifdef DEBUG_FS
AddLog(LOG_LEVEL_INFO, PSTR("open file for append %d"), cnt); AddLog(LOG_LEVEL_INFO, PSTR("SCR: open file for append %d"), cnt);
#endif #endif
} }
} }
@ -3270,7 +3270,7 @@ extern void W8960_SetGain(uint8_t sel, uint16_t value);
fvar = cnt; fvar = cnt;
glob_script_mem.file_flags[cnt].is_open = 1; glob_script_mem.file_flags[cnt].is_open = 1;
} else { } else {
AddLog(LOG_LEVEL_INFO, PSTR("file open failed")); AddLog(LOG_LEVEL_INFO, PSTR("SCR: file open failed"));
} }
break; break;
} }
@ -3283,7 +3283,7 @@ extern void W8960_SetGain(uint8_t sel, uint16_t value);
uint8_t ind = fvar; uint8_t ind = fvar;
if (ind >= SFS_MAX) ind = SFS_MAX - 1; if (ind >= SFS_MAX) ind = SFS_MAX - 1;
#ifdef DEBUG_FS #ifdef DEBUG_FS
AddLog(LOG_LEVEL_INFO, PSTR("closing file %d"), ind); AddLog(LOG_LEVEL_INFO, PSTR("SCR: closing file %d"), ind);
#endif #endif
glob_script_mem.files[ind].close(); glob_script_mem.files[ind].close();
glob_script_mem.file_flags[ind].is_open = 0; glob_script_mem.file_flags[ind].is_open = 0;
@ -4973,7 +4973,7 @@ extern char *SML_GetSVal(uint32_t index);
fvar == -1; fvar == -1;
} else { } else {
if (Is_gpio_used(rxpin) || Is_gpio_used(txpin)) { if (Is_gpio_used(rxpin) || Is_gpio_used(txpin)) {
AddLog(LOG_LEVEL_INFO, PSTR("warning: pins already used")); AddLog(LOG_LEVEL_INFO, PSTR("SCR: warning, pins already used"));
} }
glob_script_mem.sp = new TasmotaSerial(rxpin, txpin, 1, 0, rxbsiz); glob_script_mem.sp = new TasmotaSerial(rxpin, txpin, 1, 0, rxbsiz);
@ -4988,7 +4988,7 @@ extern char *SML_GetSVal(uint32_t index);
#ifdef ESP32 #ifdef ESP32
uart = glob_script_mem.sp->getUart(); uart = glob_script_mem.sp->getUart();
#endif #endif
AddLog(LOG_LEVEL_INFO, PSTR("Serial port set to %s %d bit/s at rx=%d tx=%d rbu=%d uart=%d"), GetSerialConfig().c_str(), (uint32_t)br, (uint32_t)rxpin, (uint32_t)txpin, (uint32_t)rxbsiz, uart); AddLog(LOG_LEVEL_INFO, PSTR("SCR: Serial port set to %s %d bit/s at rx=%d tx=%d rbu=%d uart=%d"), GetSerialConfig().c_str(), (uint32_t)br, (uint32_t)rxpin, (uint32_t)txpin, (uint32_t)rxbsiz, uart);
Settings->serial_config = savc; Settings->serial_config = savc;
if (rxpin == 3 and txpin == 1) ClaimSerial(); if (rxpin == 3 and txpin == 1) ClaimSerial();
@ -5328,7 +5328,7 @@ extern char *SML_GetSVal(uint32_t index);
char cbuff[32]; char cbuff[32];
sprintf(cbuff," - %02x%02x",modbus_response[mb_index],modbus_response[mb_index+1]); sprintf(cbuff," - %02x%02x",modbus_response[mb_index],modbus_response[mb_index+1]);
strcat(hexbuff,cbuff); strcat(hexbuff,cbuff);
AddLog(LOG_LEVEL_INFO,PSTR(">> %s"),hexbuff); AddLog(LOG_LEVEL_INFO,PSTR("SCR: >> %s"),hexbuff);
#endif #endif
} }
lp++; lp++;
@ -5382,7 +5382,7 @@ extern char *SML_GetSVal(uint32_t index);
#endif // ESP32 #endif // ESP32
} else { } else {
AddLog(LOG_LEVEL_INFO, PSTR("error: spi pins not defined")); AddLog(LOG_LEVEL_INFO, PSTR("SCR: error, spi pins not defined"));
} }
break; break;
} }
@ -5404,7 +5404,7 @@ extern char *SML_GetSVal(uint32_t index);
if (Is_gpio_used(glob_script_mem.spi.mosi) || Is_gpio_used(glob_script_mem.spi.miso) if (Is_gpio_used(glob_script_mem.spi.mosi) || Is_gpio_used(glob_script_mem.spi.miso)
|| Is_gpio_used(glob_script_mem.spi.sclk) ) { || Is_gpio_used(glob_script_mem.spi.sclk) ) {
AddLog(LOG_LEVEL_INFO, PSTR("warning: pins already used")); AddLog(LOG_LEVEL_INFO, PSTR("SCR: warning, pins already used"));
} }
break; break;
@ -5418,7 +5418,7 @@ extern char *SML_GetSVal(uint32_t index);
pinMode(glob_script_mem.spi.cs[index] , OUTPUT); pinMode(glob_script_mem.spi.cs[index] , OUTPUT);
digitalWrite(glob_script_mem.spi.cs[index] , 1); digitalWrite(glob_script_mem.spi.cs[index] , 1);
if (Is_gpio_used(glob_script_mem.spi.cs[index])) { if (Is_gpio_used(glob_script_mem.spi.cs[index])) {
AddLog(LOG_LEVEL_INFO, PSTR("warning: pins already used")); AddLog(LOG_LEVEL_INFO, PSTR("SCR: warning, pins already used"));
} }
break; break;
@ -7103,7 +7103,7 @@ getnext:
lp = GetNumericArgument(lp + 6, OPER_EQU, &fvar, 0); lp = GetNumericArgument(lp + 6, OPER_EQU, &fvar, 0);
int8_t pinnr = fvar; int8_t pinnr = fvar;
if (Is_gpio_used(pinnr)) { if (Is_gpio_used(pinnr)) {
AddLog(LOG_LEVEL_INFO, PSTR("warning: pins already used")); AddLog(LOG_LEVEL_INFO, PSTR("SCR: warning, pins already used"));
} }
SCRIPT_SKIP_SPACES SCRIPT_SKIP_SPACES
uint8_t mode = 0; uint8_t mode = 0;
@ -7297,7 +7297,7 @@ getnext:
} else { } else {
if (!sflag) { if (!sflag) {
tasm_cmd_activ = 1; tasm_cmd_activ = 1;
AddLog(glob_script_mem.script_loglevel&0x7f, PSTR("Script: performs \"%s\""), tmp); AddLog(glob_script_mem.script_loglevel&0x7f, PSTR("SCR: performs \"%s\""), tmp);
} else if (sflag == 2) { } else if (sflag == 2) {
// allow recursive call // allow recursive call
} else { } else {
@ -8329,13 +8329,13 @@ uint8_t DownloadFile(char *file) {
WiFiClient download_Client; WiFiClient download_Client;
if (!ufsp->exists(file)) { if (!ufsp->exists(file)) {
AddLog(LOG_LEVEL_INFO,PSTR("file not found")); AddLog(LOG_LEVEL_INFO,PSTR("SCR: file not found"));
return 0; return 0;
} }
download_file = ufsp->open(file, FS_FILE_READ); download_file = ufsp->open(file, FS_FILE_READ);
if (!download_file) { if (!download_file) {
AddLog(LOG_LEVEL_INFO,PSTR("could not open file")); AddLog(LOG_LEVEL_INFO,PSTR("SCR: could not open file"));
return 0; return 0;
} }
@ -8507,14 +8507,14 @@ void ScriptSaveSettings(void) {
strlcpy(glob_script_mem.script_ram, str.c_str(), glob_script_mem.script_size); strlcpy(glob_script_mem.script_ram, str.c_str(), glob_script_mem.script_size);
if (glob_script_mem.script_ram[0]!='>' && glob_script_mem.script_ram[1]!='D') { if (glob_script_mem.script_ram[0]!='>' && glob_script_mem.script_ram[1]!='D') {
AddLog(LOG_LEVEL_INFO, PSTR("script error: must start with >D")); AddLog(LOG_LEVEL_INFO, PSTR("SCR: error, must start with >D"));
bitWrite(Settings->rule_enabled, 0, 0); bitWrite(Settings->rule_enabled, 0, 0);
} }
SaveScript(); SaveScript();
} else { } else {
AddLog(LOG_LEVEL_INFO, PSTR("script memory error")); AddLog(LOG_LEVEL_INFO, PSTR("SCR: memory error"));
} }
SaveScriptEnd(); SaveScriptEnd();
@ -8528,10 +8528,10 @@ uint32_t script_compress(char *dest, uint32_t size) {
yield(); yield();
if (len_compressed > 0) { if (len_compressed > 0) {
dest[len_compressed] = 0; dest[len_compressed] = 0;
AddLog(LOG_LEVEL_INFO,PSTR("script compressed to %d bytes = %d %%"),len_compressed,len_compressed * 100 / strlen(glob_script_mem.script_ram)); AddLog(LOG_LEVEL_INFO,PSTR("SCR: compressed to %d bytes = %d %%"),len_compressed,len_compressed * 100 / strlen(glob_script_mem.script_ram));
return 0; return 0;
} else { } else {
AddLog(LOG_LEVEL_INFO, PSTR("script compress error: %d"), len_compressed); AddLog(LOG_LEVEL_INFO, PSTR("SCR: compress error %d"), len_compressed);
return 1; return 1;
} }
} }
@ -8559,7 +8559,7 @@ void SaveScriptEnd(void) {
int16_t res = Init_Scripter(); int16_t res = Init_Scripter();
if (res) { if (res) {
AddLog(LOG_LEVEL_INFO, PSTR("script init error: %d"), res); AddLog(LOG_LEVEL_INFO, PSTR("SCR: init error %d"), res);
return; return;
} }
@ -8917,7 +8917,7 @@ void Script_Check_Hue(String *response) {
} }
// append response // append response
#ifdef SCRIPT_HUE_DEBUG #ifdef SCRIPT_HUE_DEBUG
AddLog(LOG_LEVEL_INFO, PSTR("Hue: %s - %d "),hue_script[hue_devs].name, hue_devs); AddLog(LOG_LEVEL_INFO, PSTR("HUE: %s - %d "),hue_script[hue_devs].name, hue_devs);
#endif #endif
if (response) { if (response) {
if (TasmotaGlobal.devices_present) { if (TasmotaGlobal.devices_present) {
@ -8930,7 +8930,7 @@ void Script_Check_Hue(String *response) {
*response += String(EncodeLightId(hue_devs + TasmotaGlobal.devices_present + 1))+"\":"; *response += String(EncodeLightId(hue_devs + TasmotaGlobal.devices_present + 1))+"\":";
Script_HueStatus(response, hue_devs); Script_HueStatus(response, hue_devs);
#ifdef SCRIPT_HUE_DEBUG #ifdef SCRIPT_HUE_DEBUG
AddLog(LOG_LEVEL_INFO, PSTR("Hue: %s - %d "),response->c_str(), hue_devs); AddLog(LOG_LEVEL_INFO, PSTR("HUE: %s - %d "),response->c_str(), hue_devs);
#endif #endif
} }
hue_devs++; hue_devs++;
@ -8945,7 +8945,7 @@ void Script_Check_Hue(String *response) {
} }
#ifdef SCRIPT_HUE_DEBUG #ifdef SCRIPT_HUE_DEBUG
if (response) { if (response) {
AddLog(LOG_LEVEL_INFO, PSTR("Hue: %d"), hue_devs); AddLog(LOG_LEVEL_INFO, PSTR("HUE: %d"), hue_devs);
toLog(">>>>"); toLog(">>>>");
toLog(response->c_str()); toLog(response->c_str());
toLog(response->c_str()+700); // Was MAX_LOGSZ toLog(response->c_str()+700); // Was MAX_LOGSZ
@ -8987,8 +8987,8 @@ void Script_Handle_Hue(String path) {
#endif #endif
#ifdef SCRIPT_HUE_DEBUG #ifdef SCRIPT_HUE_DEBUG
AddLog(LOG_LEVEL_INFO, PSTR("Hue 0: %s - %d "),path.c_str(), device); AddLog(LOG_LEVEL_INFO, PSTR("HUE: 0 %s - %d "),path.c_str(), device);
AddLog(LOG_LEVEL_INFO, PSTR("Hue 1: %d, %s"), args, json); AddLog(LOG_LEVEL_INFO, PSTR("HUE: 1 %d, %s"), args, json);
#endif #endif
if (Webserver->args()) { if (Webserver->args()) {
response = "["; response = "[";
@ -9424,7 +9424,7 @@ bool ScriptMqttData(void) {
String buData = XdrvMailbox.data; String buData = XdrvMailbox.data;
#ifdef DEBUG_MQTT_EVENT #ifdef DEBUG_MQTT_EVENT
AddLog(LOG_LEVEL_INFO, PSTR("Script: MQTT Topic %s, Event %s"), XdrvMailbox.topic, XdrvMailbox.data); AddLog(LOG_LEVEL_INFO, PSTR("SCR: MQTT Topic %s, Event %s"), XdrvMailbox.topic, XdrvMailbox.data);
#endif #endif
MQTT_Subscription event_item; MQTT_Subscription event_item;
@ -9436,7 +9436,7 @@ bool ScriptMqttData(void) {
String sData = buData; String sData = buData;
#ifdef DEBUG_MQTT_EVENT #ifdef DEBUG_MQTT_EVENT
AddLog(LOG_LEVEL_INFO, PSTR("Script: Match MQTT message Topic %s with subscription topic %s and key %s"), sTopic.c_str(), event_item.Topic.c_str(),event_item.Key.c_str()); AddLog(LOG_LEVEL_INFO, PSTR("SCR: Match MQTT message Topic %s with subscription topic %s and key %s"), sTopic.c_str(), event_item.Topic.c_str(),event_item.Key.c_str());
#endif #endif
if (sTopic.startsWith(event_item.Topic)) { if (sTopic.startsWith(event_item.Topic)) {
//This topic is subscribed by us, so serve it //This topic is subscribed by us, so serve it
@ -9494,7 +9494,7 @@ bool ScriptMqttData(void) {
snprintf_P(sbuffer, sizeof(sbuffer), PSTR(">%s=\"%s\"\n"), event_item.Event.c_str(), value.c_str()); snprintf_P(sbuffer, sizeof(sbuffer), PSTR(">%s=\"%s\"\n"), event_item.Event.c_str(), value.c_str());
} }
#ifdef DEBUG_MQTT_EVENT #ifdef DEBUG_MQTT_EVENT
AddLog(LOG_LEVEL_INFO, PSTR("Script: setting script var %s"), sbuffer); AddLog(LOG_LEVEL_INFO, PSTR("SCR: setting script var %s"), sbuffer);
#endif #endif
//toLog(sbuffer); //toLog(sbuffer);
execute_script(sbuffer); execute_script(sbuffer);
@ -9657,7 +9657,7 @@ void ScriptServeFile82(void) {
if (ufsp->exists(cp)) { if (ufsp->exists(cp)) {
#endif #endif
if (download82_busy == true) { if (download82_busy == true) {
AddLog(LOG_LEVEL_INFO, PSTR("UFS 82: Download is busy")); AddLog(LOG_LEVEL_INFO, PSTR("UFS: 82 Download is busy"));
return; return;
} }
download82_busy = true; download82_busy = true;
@ -9705,9 +9705,9 @@ void WebServer82Init(void) {
http82_Server->on("/", HTTP_GET, Handle82Root); http82_Server->on("/", HTTP_GET, Handle82Root);
http82_Server->onNotFound(Handle82NotFound); http82_Server->onNotFound(Handle82NotFound);
http82_Server->begin(); http82_Server->begin();
AddLog(LOG_LEVEL_INFO, PSTR("HTTP DL Server started on port: %d "), SCRIPT_DLPORT); AddLog(LOG_LEVEL_INFO, PSTR("SCR: HTTP DL Server started on port: %d "), SCRIPT_DLPORT);
} else { } else {
AddLog(LOG_LEVEL_INFO, PSTR("HTTP DL Server failed")); AddLog(LOG_LEVEL_INFO, PSTR("SCR: HTTP DL Server failed"));
} }
} }
@ -10573,7 +10573,7 @@ int32_t web_send_file(char mc, char *fname) {
free(lbuff); free(lbuff);
return 0; return 0;
} else { } else {
AddLog(LOG_LEVEL_INFO, PSTR("WEB file %s not found"), path); AddLog(LOG_LEVEL_INFO, PSTR("SCR: WEB file %s not found"), path);
} }
free(lbuff); free(lbuff);
#endif #endif
@ -11767,7 +11767,7 @@ int32_t url2file(uint8_t fref, char *url) {
} }
} }
if (httpCode < 0) { if (httpCode < 0) {
AddLog(LOG_LEVEL_INFO,PSTR("HTTP error %d = %s"), httpCode, http.errorToString(httpCode).c_str()); AddLog(LOG_LEVEL_INFO,PSTR("SCR: HTTP error %d = %s"), httpCode, http.errorToString(httpCode).c_str());
} }
if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) { if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {
WiFiClient *stream = http.getStreamPtr(); WiFiClient *stream = http.getStreamPtr();
@ -11783,7 +11783,7 @@ int32_t url2file(uint8_t fref, char *url) {
uint32_t read = stream->readBytes(buff, size); uint32_t read = stream->readBytes(buff, size);
glob_script_mem.files[fref].write(buff, read); glob_script_mem.files[fref].write(buff, read);
len -= read; len -= read;
AddLog(LOG_LEVEL_DEBUG,PSTR("HTTP read %d"), len); AddLog(LOG_LEVEL_DEBUG,PSTR("SCR: HTTP read %d"), len);
} }
delayMicroseconds(1); delayMicroseconds(1);
} }
@ -11809,7 +11809,7 @@ int32_t http_req(char *host, char *request) {
} }
#ifdef HTTP_DEBUG #ifdef HTTP_DEBUG
AddLog(LOG_LEVEL_INFO, PSTR("HTTP heap %d"), ESP_getFreeHeap()); AddLog(LOG_LEVEL_INFO, PSTR("SCR: HTTP heap %d"), ESP_getFreeHeap());
#endif #endif
if (!mode) { if (!mode) {
@ -11827,7 +11827,7 @@ int32_t http_req(char *host, char *request) {
} }
#ifdef HTTP_DEBUG #ifdef HTTP_DEBUG
AddLog(LOG_LEVEL_INFO, PSTR("HTTP RESULT %s"), http.getString().c_str()); AddLog(LOG_LEVEL_INFO, PSTR("SCR: HTTP RESULT %s"), http.getString().c_str());
#endif #endif
#ifdef USE_WEBSEND_RESPONSE #ifdef USE_WEBSEND_RESPONSE
@ -11838,7 +11838,7 @@ int32_t http_req(char *host, char *request) {
#endif #endif
#ifdef HTTP_DEBUG #ifdef HTTP_DEBUG
AddLog(LOG_LEVEL_INFO, PSTR("HTTP MQTT BUFFER %s"), ResponseData()); AddLog(LOG_LEVEL_INFO, PSTR("SCR: HTTP MQTT BUFFER %s"), ResponseData());
#endif #endif
// AddLog(LOG_LEVEL_INFO, PSTR("JSON %s"), wd_jstr); // AddLog(LOG_LEVEL_INFO, PSTR("JSON %s"), wd_jstr);
@ -11964,7 +11964,7 @@ uint32_t call2https(const char *host, const char *path) {
if (retry == 10) { if (retry == 10) {
return 2; return 2;
} }
AddLog(LOG_LEVEL_DEBUG,PSTR("connected")); AddLog(LOG_LEVEL_DEBUG,PSTR("SCR: connected"));
String request; String request;
@ -12530,7 +12530,7 @@ bool Xdrv10(uint32_t function)
#ifdef USE_UFILESYS #ifdef USE_UFILESYS
if (ufs_type) { if (ufs_type) {
// we have a file system // we have a file system
AddLog(LOG_LEVEL_INFO,PSTR("UFILESYSTEM OK!")); AddLog(LOG_LEVEL_INFO,PSTR("SCR: ufilesystem found"));
char *script; char *script;
script = (char*)special_malloc(UFSYS_SIZE + 4); script = (char*)special_malloc(UFSYS_SIZE + 4);
if (!script) break; if (!script) break;
@ -12550,7 +12550,7 @@ bool Xdrv10(uint32_t function)
// indicates scripter use no compression // indicates scripter use no compression
bitWrite(Settings->rule_once, 6, 0); bitWrite(Settings->rule_once, 6, 0);
} else { } else {
AddLog(LOG_LEVEL_INFO,PSTR("UFILESYSTEM fail, using compression!")); AddLog(LOG_LEVEL_INFO,PSTR("SCR: No ufilesystem, using compression"));
int32_t len_decompressed; int32_t len_decompressed;
sprt = (char*)calloc(UNISHOXRSIZE + 8,1); sprt = (char*)calloc(UNISHOXRSIZE + 8,1);
if (!sprt) { break; } if (!sprt) { break; }