File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -623,6 +623,7 @@ bool ws_sdcard::CreateNewLogFile() {
623623 sizeof (log_filename_buffer) - 1 );
624624 log_filename_buffer[sizeof (log_filename_buffer) - 1 ] = ' \0 ' ;
625625 _log_filename = log_filename_buffer;
626+ _sz_cur_log_file = 0 ; // Reset the current log file size
626627
627628 // Attempt to create the new log file
628629 if (!file.open (_log_filename, O_RDWR | O_CREAT | O_AT_END))
@@ -1048,7 +1049,7 @@ bool ws_sdcard::LogJSONDoc(JsonDocument &doc) {
10481049 bufferedFile.flush (); // Send the remaining bytes
10491050 file.close ();
10501051 // Update log file's size
1051- _sz_cur_log_file = szJson + 2 ; // +2 bytes for "\n"
1052+ _sz_cur_log_file += ( szJson + 2 ) ; // +2 for newline
10521053 // print the doc to the serial
10531054 serializeJson (doc, Serial);
10541055 Serial.print (" \n " );
You can’t perform that action at this time.
0 commit comments