TelemetryDeck / SwiftSDK

Swift SDK for TelemetryDeck, a privacy-conscious analytics service for apps and websites.
https://telemetrydeck.com/
Other
155 stars 32 forks source link

Add structured logging as an alternative to stdout printing #150

Open davidrothera opened 5 months ago

davidrothera commented 5 months ago

This fixes #131 and adds a oslog handler for logging as an option.

Rather than change all logging to use this new endpoint by default I left it as an option for the client to decide as perhaps people could be relying on stdout printing.

The new variable is gated around the platforms which support this new structured logging API (iOS 14 and similar).

davidrothera commented 5 months ago

One option which I did consider was a more thorough change to logging where we could pass through the subsystem (in oslog parlance) of where the log comes from but I didn't implement this as the library isn't large enough that the call site could be one of 100 subsystems.