mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-07 20:16:55 +03:00
write logfile logs earlier, shorten startup banner, add uptime to logfile (#1443)
Co-authored-by: CaCO3 <caco@ruinelli.ch>
This commit is contained in:
@@ -164,7 +164,9 @@ void ClassLogFile::WriteToDedicatedFile(std::string _fn, esp_log_level_t level,
|
||||
break;
|
||||
}
|
||||
|
||||
logline = logline + "\t<" + loglevelString + ">\t" + message.c_str() + "\n";
|
||||
char uptime[20];
|
||||
snprintf(uptime, sizeof(uptime), "%8d", (uint32_t)(esp_timer_get_time()/1000/1000)); // in seconds
|
||||
logline = "[" + std::string(uptime) + "] " + logline + "\t<" + loglevelString + ">\t" + message + "\n";
|
||||
fputs(logline.c_str(), pFile);
|
||||
fclose(pFile);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user