Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use os_log instead of print for logging #31

Closed
jaanus opened this issue Jun 16, 2021 · 4 comments · Fixed by #92
Closed

Use os_log instead of print for logging #31

jaanus opened this issue Jun 16, 2021 · 4 comments · Fixed by #92
Labels
enhancement New feature or request
Projects

Comments

@jaanus
Copy link

jaanus commented Jun 16, 2021

Observed: Telemetry uses print-logging.

Expected: os_log is the modern recommended way of logging. Consider using that. https://developer.apple.com/documentation/os/logging/generating_log_messages_from_your_code

@winsmith
Copy link
Contributor

That is a very good idea. Thanks for that. I'll double check if os_log is also available on Linux

@winsmith winsmith added the enhancement New feature or request label Jun 17, 2021
@winsmith winsmith added this to Backlog in Viewer App via automation Jun 17, 2021
@winsmith winsmith moved this from Backlog to To Do in Viewer App Jun 17, 2021
@jaanus
Copy link
Author

jaanus commented Jun 17, 2021

Good point. os_log isn’t available on Linux. https://github.com/apple/swift-log is the official thing to use on Linux. (And I suppose it works on other platforms too, some Server-Side Swift things like Vapor use it across all platforms, so AppTelemetry might too.)

@winsmith winsmith moved this from To Do to Backlog in Viewer App Jul 6, 2021
@Sherlouk
Copy link
Contributor

SwiftLog has the added ability of aggregating and sending logs up to a remote server for error monitoring.

I'm not sure it makes sense for this SDK to add a dependency though, and indeed it complicated the recent CocoaPods install.

Perhaps we support clients providing a simple log closure, defaulting to print if not overridden?

@jaanus
Copy link
Author

jaanus commented Feb 21, 2023

Perhaps we support clients providing a simple log closure, defaulting to print if not overridden?

Yay for dependency injection. This sounds fine.

Viewer App automation moved this from Backlog to Done Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

3 participants