瀏覽代碼

fix SimpleLogReporter prev log

Ivan Valkou 5 年之前
父節點
當前提交
60ee38db69
共有 1 個文件被更改,包括 1 次插入0 次删除
  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)
             }