Skip to content

Commit

Permalink
✨ :: [#496] LogHistoryStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
baekteun committed Apr 23, 2024
1 parent a7b6d4e commit baef00c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Projects/Modules/LogManager/Sources/AnalyticsLogManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ public extension LogManager {
) {
#if RELEASE
Analytics.logEvent(log.name, parameters: log.params)
#elseif DEBUG
LogHistoryStorage.shared.appendHistory(log: log)
#endif
let message = """
\(log.name) logged
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#if DEBUG
import Foundation

final class LogHistoryStorage {
static let shared = LogHistoryStorage()

private(set) var logHistory: [any AnalyticsLogType] = []

func appendHistory(log: any AnalyticsLogType) {
logHistory.append(log)
}
}

#endif

0 comments on commit baef00c

Please sign in to comment.