From 2afa95bd3be3c13535b807bf971555fa69f6926d Mon Sep 17 00:00:00 2001 From: Dmitry Medyuho Date: Sun, 25 Apr 2021 00:36:06 +0300 Subject: [PATCH] Refactor --- MultiSoundChanger/Sources/Utils/Logger.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MultiSoundChanger/Sources/Utils/Logger.swift b/MultiSoundChanger/Sources/Utils/Logger.swift index 20d64d9..b234053 100644 --- a/MultiSoundChanger/Sources/Utils/Logger.swift +++ b/MultiSoundChanger/Sources/Utils/Logger.swift @@ -15,7 +15,7 @@ enum Logger { case warning = "🟠" case error = "🔴" } - + private enum Symbol: String { case newLine = "\n" } @@ -25,7 +25,7 @@ enum Logger { case dataError } - private static var isFirstLog = true + private static var isLogFileRemoved = false private static var bundleIdentifier: String { guard let bundleIdentifier = Bundle.main.bundleIdentifier else { @@ -112,10 +112,10 @@ enum Logger { } private static func removeLogFileIfNeeded(url: URL) throws { - guard isFirstLog else { + guard !isLogFileRemoved else { return } - isFirstLog = false + isLogFileRemoved = true guard FileManager.default.fileExists(atPath: url.path) else { return }