mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-09 21:17:06 +03:00
* 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>
41 lines
1.4 KiB
C++
41 lines
1.4 KiB
C++
|
|
#include <string>
|
|
#include "esp_log.h"
|
|
|
|
|
|
class ClassLogFile
|
|
{
|
|
private:
|
|
std::string logroot;
|
|
std::string logfile;
|
|
std::string dataroot;
|
|
std::string datafile;
|
|
unsigned short retentionInDays;
|
|
esp_log_level_t loglevel;
|
|
public:
|
|
ClassLogFile(std::string _logpath, std::string _logfile, std::string _logdatapath, std::string _datafile);
|
|
|
|
std::string getESPHeapInfo();
|
|
|
|
void WriteHeapInfo(std::string _id);
|
|
|
|
void setLogLevel(esp_log_level_t _logLevel);
|
|
void SetRetention(unsigned short _retentionInDays);
|
|
|
|
void WriteToFile(esp_log_level_t level, std::string tag, std::string message, bool _time);
|
|
void WriteToFile(esp_log_level_t level, std::string tag, std::string message);
|
|
|
|
void WriteToDedicatedFile(std::string _fn, esp_log_level_t level, std::string message, bool _time = true);
|
|
|
|
void CreateLogDirectories();
|
|
void RemoveOld();
|
|
|
|
// void WriteToData(std::string _ReturnRawValue, std::string _ReturnValue, std::string _ReturnPreValue, std::string _ErrorMessageText, std::string _digital, std::string _analog);
|
|
void WriteToData(std::string _timestamp, std::string _name, std::string _ReturnRawValue, std::string _ReturnValue, std::string _ReturnPreValue, std::string _ReturnRateValue, std::string _ReturnChangeAbsolute, std::string _ErrorMessageText, std::string _digital, std::string _analog);
|
|
|
|
|
|
std::string GetCurrentFileName();
|
|
std::string GetCurrentFileNameData();
|
|
};
|
|
|
|
extern ClassLogFile LogFile; |