From 965b09cc78f247129c9277933af904fb77c371a0 Mon Sep 17 00:00:00 2001 From: Dmitry Borisenko <49808844+DmitryBorisenko33@users.noreply.github.com> Date: Sun, 3 Jan 2021 01:20:38 +0100 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/items/vLogging.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/items/vLogging.cpp b/src/items/vLogging.cpp index 56f02735..51f8a3f7 100644 --- a/src/items/vLogging.cpp +++ b/src/items/vLogging.cpp @@ -55,16 +55,16 @@ void LoggingClass::execute(String keyOrValue) { SerialPrint("I", "Logging", "http://" + WiFi.localIP().toString() + "/" + filename + " lines " + String(cnt, DEC) + ", size " + String(sz)); - if ((cnt > _maxPoints + 1) || cnt == -1) { + if ((cnt > _maxPoints + 1)) { removeFile(filename); SerialPrint("E", "Logging", "file been remooved: " + filename + " " + String(cnt) + ">" + String(_maxPoints)); cnt = 0; } if (loggingValue != "") { - if (cnt > _maxPoints) { //удаляем старую строку и добавляем новую + if (cnt >= _maxPoints) { //удаляем старую строку и добавляем новую String logData = readFile(filename, 20480); //10240 - SerialPrint("I", "Logging", "Free heap " + ESP.getFreeHeap()); + SerialPrint("I", "Logging", "Free heap " + String(ESP.getFreeHeap())); if (logData == "large") { SerialPrint("E", "Logging", "File is very large"); }