Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
rlxone committed Apr 24, 2021
1 parent 0e6f59f commit 2afa95b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions MultiSoundChanger/Sources/Utils/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ enum Logger {
case warning = "馃煚"
case error = "馃敶"
}

private enum Symbol: String {
case newLine = "\n"
}
Expand All @@ -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 {
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 2afa95b

Please sign in to comment.