added log level to logfile, adjusted some loglevels

This commit is contained in:
George Ruinelli
2022-10-22 18:05:08 +02:00
parent 0a2b6b71ca
commit 1e698440f9
22 changed files with 138 additions and 114 deletions

View File

@@ -296,7 +296,7 @@ esp_err_t handler_ota_update(httpd_req_t *req)
LogFile.WriteHeapInfo("handler_ota_update - Start");
#endif
LogFile.WriteToFile("handler_ota_update");
LogFile.WriteToFile(ESP_LOG_DEBUG, "handler_ota_update");
char _query[200];
char _filename[100];
char _valuechar[30];
@@ -493,8 +493,8 @@ void task_reboot(void *pvParameter)
void doReboot(){
LogFile.SwitchOnOff(true);
LogFile.WriteToFile("Reboot triggered by Software (5s).");
LogFile.WriteToFile("Reboot in 5sec");
LogFile.WriteToFile(ESP_LOG_INFO, "Reboot triggered by Software (5s).");
LogFile.WriteToFile(ESP_LOG_WARN, "Reboot in 5sec");
xTaskCreate(&task_reboot, "reboot", configMINIMAL_STACK_SIZE * 64, NULL, 10, NULL);
// KillTFliteTasks(); // kills itself
gpio_handler_destroy();
@@ -510,7 +510,7 @@ esp_err_t handler_reboot(httpd_req_t *req)
LogFile.WriteHeapInfo("handler_reboot - Start");
#endif
LogFile.WriteToFile("handler_reboot");
LogFile.WriteToFile(ESP_LOG_DEBUG, "handler_reboot");
ESP_LOGI(TAGPARTOTA, "!!! System will restart within 5 sec!!!");
const char* resp_str = "<body style='font-family: arial'> <h3 id=t></h3></body><script>var h='Rebooting!<br>The page will automatically reload in around 25..60s.<br>'; document.getElementById('t').innerHTML=h; setInterval(function (){h +='.'; document.getElementById('t').innerHTML=h; fetch(window.location.hostname,{mode: 'no-cors'}).then(r=>{parent.location.href=('/index.html');})}, 1000);</script>";
httpd_resp_send(req, resp_str, strlen(resp_str));