mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-10 05:26:52 +03:00
Boot phase: Add more error handling + provide verbose output in error cases (#2020)
* WLAN: add error handling * WLAN: parameter global struct * WLAN.ini -> more info text * RSSIThreshold * Rename logs * Boot process: error handling * Update texts * Comments * Init sequence * Prepare for check dir creation * add check makedir, update logs * Blink code for OTA+SoftAP * Blink code for missing time snyc * Update * reboot -> switch LED off * Update log texts * Update * Update log texts * create empty default folders at startup * Update * Adapt log level * Print log level switch * Update * Update text * Add SD free space to log * WIFI/MQTT disconnect message set to WARN (+ ERROR)
This commit is contained in:
@@ -78,11 +78,11 @@ void ClassLogFile::WriteToData(std::string _timestamp, std::string _name, std::s
|
||||
}
|
||||
|
||||
|
||||
void ClassLogFile::setLogLevel(esp_log_level_t _logLevel){
|
||||
loglevel = _logLevel;
|
||||
|
||||
void ClassLogFile::setLogLevel(esp_log_level_t _logLevel)
|
||||
{
|
||||
std::string levelText;
|
||||
|
||||
// Print log level to log file
|
||||
switch(_logLevel) {
|
||||
case ESP_LOG_WARN:
|
||||
levelText = "WARNING";
|
||||
@@ -95,13 +95,16 @@ void ClassLogFile::setLogLevel(esp_log_level_t _logLevel){
|
||||
case ESP_LOG_DEBUG:
|
||||
levelText = "DEBUG";
|
||||
break;
|
||||
|
||||
case ESP_LOG_ERROR:
|
||||
default:
|
||||
levelText = "ERROR";
|
||||
break;
|
||||
}
|
||||
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Set log level to " + levelText);
|
||||
|
||||
ESP_LOGI(TAG, "Log Level set to %s", levelText.c_str());
|
||||
// set new log level
|
||||
loglevel = _logLevel;
|
||||
|
||||
/*
|
||||
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Test");
|
||||
@@ -386,14 +389,17 @@ void ClassLogFile::RemoveOldDataLog()
|
||||
}
|
||||
|
||||
|
||||
void ClassLogFile::CreateLogDirectories()
|
||||
bool ClassLogFile::CreateLogDirectories()
|
||||
{
|
||||
MakeDir("/sdcard/log");
|
||||
MakeDir("/sdcard/log/data");
|
||||
MakeDir("/sdcard/log/analog");
|
||||
MakeDir("/sdcard/log/digit");
|
||||
MakeDir("/sdcard/log/message");
|
||||
MakeDir("/sdcard/log/source");
|
||||
bool bRetval = false;
|
||||
bRetval = MakeDir("/sdcard/log");
|
||||
bRetval = MakeDir("/sdcard/log/data");
|
||||
bRetval = MakeDir("/sdcard/log/analog");
|
||||
bRetval = MakeDir("/sdcard/log/digit");
|
||||
bRetval = MakeDir("/sdcard/log/message");
|
||||
bRetval = MakeDir("/sdcard/log/source");
|
||||
|
||||
return bRetval;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user