Skip to content

Commit

Permalink
[#21] 로깅 시스템 버전 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
jayden000106 committed Feb 24, 2024
1 parent ba38d5e commit b2a9d02
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Sources/YLS-iOS/Models/YLSEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import Foundation
struct YLSEvent {
let hashedID: String
let timestamp: String
let version: Int
let event: [String: Any]

func fetchDictionary() -> [String: Any] {
return ["hashedID": hashedID, "timestamp": timestamp, "event": event]
return ["hashedID": hashedID, "timestamp": timestamp, "version": version, "event": event]
}
}
4 changes: 3 additions & 1 deletion Sources/YLS-iOS/YLS_iOS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ let logger = Logger(subsystem: "YLS", category: "Logging")
public final class YLS {
public static let shared = YLS()

private let version = 1

private var url: URL?
private var hashedID: String?
private var caches: [YLSEvent] = []
Expand Down Expand Up @@ -83,7 +85,7 @@ public final class YLS {
var event: [String: Any] = ["platform": "iOS", "event": name]
event = event.merging(extra) { (current, new) in new }

let ylsEvent = YLSEvent(hashedID: hashedID, timestamp: timestamp, event: event)
let ylsEvent = YLSEvent(hashedID: hashedID, timestamp: timestamp, version: version, event: event)
self.caches.append(ylsEvent)

if self.caches.count >= 10 {
Expand Down

0 comments on commit b2a9d02

Please sign in to comment.