firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.58k stars 1.46k forks source link

Move `GULLogger` to `os_log` for iOS 10+ #1650

Closed ryanwilson closed 2 months ago

ryanwilson commented 6 years ago

Currently we use asl_log for all logging within GULLogger, but it's deprecated. os_log was introduced in iOS 10 as a faster and more robust logging solution.

We should move to os_log for all iOS versions above iOS 10, and use the old asl_log for iOS 8 and 9 until we drop support for those versions.

morganchen12 commented 5 years ago

Unassigning bstpierr since he no longer works on Firebase.

paulb777 commented 2 years ago

Alternative would be to directly use os_log from the product SDKs and deprecate FIRLogger and GULLogger.

First step will be to review https://developer.apple.com/documentation/os/logging and come up with a design

mortenbekditlevsen commented 2 years ago

Just providing another alternative - in case running on non-Darwin platforms were a goal - and for the frameworks that are already in Swift. :-)

https://github.com/apple/swift-log

Which could then on Darwin platforms be used to log to os_log through:

https://github.com/chrisaljoudi/swift-log-oslog And on other platforms, another logging client could be injected.

Just a thought 😊

paulb777 commented 2 years ago

Deprioritizing for Firebase 10 in favor of thinking about a logging strategy that is Swift first

andrewheard commented 3 months ago

Alternative would be to directly use os_log from the product SDKs and deprecate FIRLogger and GULLogger.

First step will be to review developer.apple.com/documentation/os/logging and come up with a design

@paulb777 If we use os_log directly in SDKs then, by default, messages at all logging levels will be shown in the Xcode console (example). Developers can filter them like so: Xcode Console Log Filters Screenshot

This would, however, be fairly different from the way that logging levels are controlled now with the -FIRDebugEnabled argument among others. We also filter DEBUG and INFO messages by default as well.