изменение алгоритма логгирования

This commit is contained in:
Dmitry Borisenko
2022-08-27 00:57:19 +02:00
parent e3fc7a7416
commit 162f4de45e
6 changed files with 111 additions and 90 deletions

View File

@@ -201,8 +201,19 @@ void cleanDirectory(String path) {
onFlashWrite();
}
void saveDataDB(String id, String data) {
String path = "/db/" + id + ".txt";
removeFile(path);
addFileLn(path, data);
}
String readDataDB(String id) {
String path = "/db/" + id + ".txt";
return readFile(path, 2000);
}
//счетчик количества записей на флешь за сеанс
void onFlashWrite() {
flashWriteNumber++;
SerialPrint(F("->"), F("FS"), F("write data on flash"));
// SerialPrint(F("->"), F("FS"), F("write data on flash"));
}

View File

@@ -6,6 +6,7 @@ void SerialPrint(String errorLevel, String module, String msg) {
tosend = prettyMillis(millis());
// if (module == "Loging") {
tosend = tosend + " [" + errorLevel + "] [" + module + "] " + msg;
Serial.println(tosend);
@@ -14,4 +15,5 @@ void SerialPrint(String errorLevel, String module, String msg) {
standWebSocket.broadcastTXT("/log|" + tosend);
}
}
//}
}