Parcourir la source

fix SimpleLogReporter prev log

Ivan Valkou il y a 5 ans
Parent
commit
60ee38db69
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  1. 1 0
      FreeAPS/Sources/Logger/IssueReporter/SimpleLogReporter.swift

+ 1 - 0
FreeAPS/Sources/Logger/IssueReporter/SimpleLogReporter.swift

@@ -36,6 +36,7 @@ final class SimpleLogReporter: IssueReporter {
             if let attributes = try? fileManager.attributesOfItem(atPath: SimpleLogReporter.logFile),
                let creationDate = attributes[.creationDate] as? Date, creationDate < startOfDay
             {
+                try? fileManager.removeItem(atPath: SimpleLogReporter.logFilePrev)
                 try? fileManager.moveItem(atPath: SimpleLogReporter.logFile, toPath: SimpleLogReporter.logFilePrev)
                 createFile(at: startOfDay)
             }