Wire PostHog iOS SDK into existing EventLogger pattern so all 60+ call sites flow to self-hosted PostHog instance with zero changes. Sets subscription person properties for segmentation on foreground. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
23 lines
436 B
Swift
23 lines
436 B
Swift
//
|
|
// EventLogger.swift
|
|
// Feels
|
|
//
|
|
// Created by Trey Tartt on 3/10/22.
|
|
//
|
|
|
|
import Foundation
|
|
#if canImport(PostHog)
|
|
import PostHog
|
|
#endif
|
|
|
|
class EventLogger {
|
|
static func log(event: String, withData data: [String: Any]? = nil) {
|
|
#if DEBUG
|
|
print("[EventLogger] \(event)", data ?? "")
|
|
#endif
|
|
#if canImport(PostHog)
|
|
PostHogSDK.shared.capture(event, properties: data)
|
|
#endif
|
|
}
|
|
}
|