-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
bevy_log: Use os_log
on iOS
#4462
Conversation
6a72b07
to
6ef8577
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a way to test it but the code looks good to me other than that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to merge this optimistically; @HackerFoo please open a new issue or PR if you run into problems on iOS.
The code itself is good and well explained.
bors r+
Merge conflict. |
@HackerFoo sorry for dropping the ball on this, could you update this PR? |
Ping @HackerFoo: I'm leaving this in the milestone because it seems like the merge conflict should be easy. |
You added a new example but didn't add metadata for it. Please update the root Cargo.toml file. |
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Hmm multiple new conflicting build deps (due to an older version of bindgen). Not as bad as non-build deps, but also not great. |
|
I don't have the setup or expertise to validate this independently: adding |
@alice-i-cecile Hi, I thought this "S-Adopt-Me" PR would be a good first simple Bevy contribution. I've merged the latest This is my branch: https://github.com/therealbnut/bevy/tree/use-oslog-for-ios I believe I've preserved the PR's orignal intent after the merge conflict, but as the code is changed and simplified now it may be worth a quick look to check I haven't removed something by mistake. It's also worth noting that the dependency this adds hasn't had bug fixes released in a few years, so we may want to consider one or more of:
Future work In a follow-up PR it might be good to make the |
Fantastic stuff: can you open a PR with those comments in a Questions for Reviewers section? I'll respond to your questions there, so the answers don't get lost. I'm in favor of a merge-as-incremental-improvement strategy, but I agree with your concerns about dead dependencies and have ideas to address that. |
Thanks @alice-i-cecile, I've made that PR here, I hope that's what you meant. |
Closing in favour of #13364. |
@richchurcher thanks for the reminder, my PR on the third-party library blocking #13364 was finally merged, so hopefully that fixes the security advisories |
# Objective On mobile devices, it's best to use the OS's native logging due to the difficulty of accessing the console. This is already done for Android. This is an updated version of #4462. ## Solution This PR uses Absolucy's [tracing-oslog](https://github.com/Absolucy/tracing-oslog) ([ZLib license](https://github.com/Absolucy/tracing-oslog/blob/main/LICENSE.md)) for iOS in order to use Apple's `os_log`. ## Testing I ran `examples/mobile` with the logging from `examples/app/logs.rs` on an iOS device, I then checked the logs could be filtered in the MacOS Console.app. ## Changelog - Change bevy_log to use Apple's os_log on iOS. ## Questions for Reviewers It's worth noting that the dependency this adds hasn't had bug fixes released in a few years, so we may want to consider one or more of: 1. a feature flag to opt-in, and it would also allow `os_log` on MacOS 2. merge as-is and have some (minor?) upstream bugs 3. hold off on this PR until a suitable alternative dependency arises 4. maintain our own implementation ## Future work In a follow-up PR it might be good to make the `subsystem` field have a better default value, like [this one](https://github.com/bevyengine/bevy/blob/main/examples/mobile/bevy_mobile_example.xcodeproj/project.pbxproj#L363). That value can be retrieved programmatically if we bind another system API (For posterity in Swift this is `Bundle.main.bundleIdentifier`, but the C/ObjC equivalent is likely easier to bind). This would almost always be the correct value, while the current default is unlikely to ever be correct. --------- Co-authored-by: Dusty DeWeese <dustin.deweese@gmail.com> Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> Co-authored-by: Carter Anderson <mcanders1@gmail.com> Co-authored-by: François Mockers <francois.mockers@vleue.com>
Objective
On mobile devices, it's best to use the OS's native logging due to the difficulty of accessing the console. This is already done for Android.
Solution
This PR uses Absolucy's
tracing-oslog
(ZLib license) for iOS in order to use Apple'sos_log
.Changelog
bevy_log
to use Apple'sos_log
on iOS.