Skip to content

Commit

Permalink
delete logs on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
creepymonster committed Dec 9, 2021
1 parent 8345e64 commit a76ae1a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion LibreDirect/Logging/Log.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public enum Log {
Self.log(message: message, type: .error, log: log, error: error, file: file, line: line, function: function)
}

public static func clear() {
public static func deleteLogs() {
fileLogger.deleteLogs()
}

Expand Down
8 changes: 8 additions & 0 deletions LibreDirect/Modules/ActionLog/ActionLog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ import Foundation
func actionLogMiddleware() -> Middleware<AppState, AppAction> {
return { _, action, _ in
Log.info("Triggered action: \(action)")

switch action {
case .startup:
Log.deleteLogs()

default:
break
}

return Empty().eraseToAnyPublisher()
}
Expand Down

0 comments on commit a76ae1a

Please sign in to comment.