Add tag to logfile write (#1287)

* HTML: implement data viewer

* Correct CSV error

* Improve OTA

* Use consistent Log TAG syntax, name TAG variable the same in every file.

* .

* .

* .

* .

* .

* Update server_tflite.cpp

* Correct CSV error

* Improve OTA

* Use consistent Log TAG syntax, name TAG variable the same in every file.

* .

* .

* .

* .

* .

* Update server_tflite.cpp

* .

* .

* .

* .

* .

* .

* .

* .

Co-authored-by: jomjol <30766535+jomjol@users.noreply.github.com>
This commit is contained in:
CaCO3
2022-11-06 08:13:53 +01:00
committed by GitHub
parent 529690ec60
commit d1e7ef1fce
31 changed files with 450 additions and 436 deletions

View File

@@ -16,6 +16,7 @@ extern "C" {
#include "CImageBasis.h"
#include "esp_log.h"
static const char* TAG = "FLOW IMG";
ClassFlowImage::ClassFlowImage(const char* logTag)
{
@@ -47,7 +48,7 @@ string ClassFlowImage::CreateLogFolder(string time) {
string logPath = LogImageLocation + "/" + time.LOGFILE_TIME_FORMAT_DATE_EXTR + "/" + time.LOGFILE_TIME_FORMAT_HOUR_EXTR;
isLogImage = mkdir_r(logPath.c_str(), S_IRWXU) == 0;
if (!isLogImage) {
LogFile.WriteToFile(ESP_LOG_ERROR, "Can't create log folder for analog images. Path " + logPath);
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Can't create log folder for analog images. Path " + logPath);
}
return logPath;
@@ -128,7 +129,7 @@ void ClassFlowImage::RemoveOldLogs()
}
}
}
LogFile.WriteToFile(ESP_LOG_INFO, "Image folder deleted: " + std::to_string(deleted) + ". Image folder not deleted: " + std::to_string(notDeleted));
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Image folder deleted: " + std::to_string(deleted) + ". Image folder not deleted: " + std::to_string(notDeleted));
closedir(dir);
}