SwiftSDK icon indicating copy to clipboard operation
SwiftSDK copied to clipboard

Add structured logging as an alternative to stdout printing

Open davidrothera opened this issue 1 year ago • 1 comments

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 avatar Apr 22 '24 21:04 davidrothera

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.

davidrothera avatar Apr 22 '24 21:04 davidrothera

Closing this in favor of https://github.com/TelemetryDeck/SwiftSDK/pull/195. Thanks again @davidrothera!

Jeehut avatar Oct 31 '24 15:10 Jeehut