     
     private lazy var dateFormatter: DateFormatter = {
         let formatter = DateFormatter()
-        formatter.dateFormat = "yyyy-MM-dd-HH-mm"
+        switch fileTime {
+        case .dateBased:
+            formatter.dateFormat = "yyyy-MM-dd"
+        case .minuteBased:
+            formatter.dateFormat = "yyyy-MM-dd-HH-mm"
+        }
         return formatter
     }()
     

        let logsIdentifier = identifier + ".logs"
        let logsFolder = used.appendingPathComponent(logsIdentifier)

        do {
            try FileManager.default.createDirectory(at: logsFolder, withIntermediateDirectories: true, attributes: nil)
        } catch {
            print("Create db folder error \(error)")
        }
        return logsFolder
    }()

    public convenience init(appGroup: String, name: String? = nil, keep: Keep = .forever) {
        self.init(appGroup: appGroup, directory: .documentDirectory, name: name, keep: keep)
    }
    
    public convenience init(saveInDirectory: FileManager.SearchPathDirectory = .documentDirectory, name: String? = nil, keep: Keep = .forever) {
        self.init(appGroup: nil, directory: saveInDirectory, name: name, keep: keep)
    }
    
    private init(appGroup: String?, directory: FileManager.SearchPathDirectory, name: String?, keep: Keep) {
        self.appGroup = appGroup
        saveInDirectory = directory
        proposedName = name
        DispatchQueue.global(qos: .utility).async {
            self.cleanOld(with: keep)
        }

        
        do {
            try FileManager.default.createDirectory(at: path, withIntermediateDirectories: true, attributes: nil)
        } catch {
            print("Create logs folder error \(error)")
        }
    }
