mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-10 21:46:55 +03:00
replaced printf usage in LogFile.WriteToFile()
This commit is contained in:
@@ -219,7 +219,7 @@ static esp_err_t http_resp_dir_html(httpd_req_t *req, const char *dirpath, const
|
|||||||
ESP_LOGD(TAG, "entrypath: <%s>", entrypath);
|
ESP_LOGD(TAG, "entrypath: <%s>", entrypath);
|
||||||
|
|
||||||
if (!dir) {
|
if (!dir) {
|
||||||
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Failed to stat dir: %s", dirpath);
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Failed to stat dir: " + std::string(dirpath) + "!");
|
||||||
/* Respond with 404 Not Found */
|
/* Respond with 404 Not Found */
|
||||||
httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, get404());
|
httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, get404());
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
@@ -361,7 +361,7 @@ static esp_err_t send_datafile(httpd_req_t *req, bool send_full_file)
|
|||||||
|
|
||||||
fd = OpenFileAndWait(currentfilename.c_str(), "r");
|
fd = OpenFileAndWait(currentfilename.c_str(), "r");
|
||||||
if (!fd) {
|
if (!fd) {
|
||||||
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Failed to read existing file: %s", filepath);
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Failed to read existing file: " + std::string(filepath) +"!");
|
||||||
/* Respond with 404 Error */
|
/* Respond with 404 Error */
|
||||||
httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, get404());
|
httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, get404());
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
@@ -446,7 +446,7 @@ static esp_err_t send_logfile(httpd_req_t *req, bool send_full_file)
|
|||||||
|
|
||||||
fd = OpenFileAndWait(currentfilename.c_str(), "r");
|
fd = OpenFileAndWait(currentfilename.c_str(), "r");
|
||||||
if (!fd) {
|
if (!fd) {
|
||||||
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Failed to read existing file: %s", filepath);
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Failed to read existing file: " + std::string(filepath) +"!");
|
||||||
/* Respond with 404 Error */
|
/* Respond with 404 Error */
|
||||||
httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, get404());
|
httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, get404());
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
@@ -566,7 +566,7 @@ static esp_err_t download_get_handler(httpd_req_t *req)
|
|||||||
|
|
||||||
/* If file not present on SPIFFS check if URI
|
/* If file not present on SPIFFS check if URI
|
||||||
* corresponds to one of the hardcoded paths */
|
* corresponds to one of the hardcoded paths */
|
||||||
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Failed to stat file: %s!", filepath);
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Failed to stat file: " + std::string(filepath) + "!");
|
||||||
/* Respond with 404 Not Found */
|
/* Respond with 404 Not Found */
|
||||||
httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, get404());
|
httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, get404());
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
@@ -574,7 +574,7 @@ static esp_err_t download_get_handler(httpd_req_t *req)
|
|||||||
|
|
||||||
fd = OpenFileAndWait(filepath, "r");
|
fd = OpenFileAndWait(filepath, "r");
|
||||||
if (!fd) {
|
if (!fd) {
|
||||||
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Failed to read existing file: %s!", filepath);
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Failed to read existing file: " + std::string(filepath) +"!");
|
||||||
/* Respond with 404 Error */
|
/* Respond with 404 Error */
|
||||||
httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, get404());
|
httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, get404());
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
|
|||||||
Reference in New Issue
Block a user