mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
изменение алгоритма логгирования
This commit is contained in:
@@ -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"));
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
//}
|
||||
}
|
||||
Reference in New Issue
Block a user