bevy/crates
Andrew 6a39c33d49
Use oslog for ios (#13364)
# 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
https://github.com/bevyengine/bevy/pull/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>
2024-10-11 08:58:14 +00:00
..
bevy_a11y
bevy_animation Make AnimatableCurve::curve public (#15831) 2024-10-10 18:51:17 +00:00
bevy_app Rename App/World::observe to add_observer, EntityWorldMut::observe_entity to observe. (#15754) 2024-10-09 15:39:29 +00:00
bevy_asset Remove the Component trait implementation from Handle (#15796) 2024-10-09 21:10:01 +00:00
bevy_audio Fix audio not playing (#15638) 2024-10-04 01:07:09 +00:00
bevy_color Remove thiserror from bevy_color (#15777) 2024-10-09 14:18:41 +00:00
bevy_core
bevy_core_pipeline Type safe retained render world (#15756) 2024-10-10 18:47:04 +00:00
bevy_derive
bevy_dev_tools Text rework (#15591) 2024-10-09 18:35:36 +00:00
bevy_diagnostic Update sysinfo requirement from 0.31.0 to 0.32.0 (#15697) 2024-10-07 07:31:17 +00:00
bevy_dylib
bevy_ecs Use oslog for ios (#13364) 2024-10-11 08:58:14 +00:00
bevy_encase_derive
bevy_gilrs Remove thiserror from bevy_gilrs (#15773) 2024-10-09 14:21:25 +00:00
bevy_gizmos Fix gizmos (#15836) 2024-10-10 22:04:04 +00:00
bevy_gltf Remove the Component trait implementation from Handle (#15796) 2024-10-09 21:10:01 +00:00
bevy_hierarchy Add more tools for traversing hierarchies (#15627) 2024-10-07 15:24:57 +00:00
bevy_image Remove thiserror from bevy_image (#15771) 2024-10-09 14:23:53 +00:00
bevy_input Remove thiserror from bevy_input (#15770) 2024-10-09 14:23:01 +00:00
bevy_internal Feature-gate all image formats (#15586) 2024-10-07 16:37:45 +00:00
bevy_log Use oslog for ios (#13364) 2024-10-11 08:58:14 +00:00
bevy_macro_utils
bevy_math Put curve-related stuff behind a feature (#15790) 2024-10-09 16:38:23 +00:00
bevy_mesh Remove thiserror from bevy_mesh (#15768) 2024-10-09 14:24:54 +00:00
bevy_mikktspace
bevy_pbr Type safe retained render world (#15756) 2024-10-10 18:47:04 +00:00
bevy_picking Rename App/World::observe to add_observer, EntityWorldMut::observe_entity to observe. (#15754) 2024-10-09 15:39:29 +00:00
bevy_ptr
bevy_reflect bevy_reflect: Add crate level functions feature docs (#15086) 2024-10-09 18:06:56 +00:00
bevy_remote Watching versions of bevy/get and bevy/list with HTTP SSE (#15608) 2024-10-08 16:21:46 +00:00
bevy_render Type safe retained render world (#15756) 2024-10-10 18:47:04 +00:00
bevy_scene Rename App/World::observe to add_observer, EntityWorldMut::observe_entity to observe. (#15754) 2024-10-09 15:39:29 +00:00
bevy_sprite Fix broken mesh2d (#15838) 2024-10-10 21:28:45 +00:00
bevy_state Add World::get_resource_or_init as an alternative to World::get_resource_or_insert_with (#15758) 2024-10-09 20:56:26 +00:00
bevy_tasks
bevy_text Type safe retained render world (#15756) 2024-10-10 18:47:04 +00:00
bevy_time Remove thiserror from bevy_time (#15759) 2024-10-09 14:13:28 +00:00
bevy_transform Remove thiserror from bevy_transform (#15761) 2024-10-09 14:27:30 +00:00
bevy_ui Type safe retained render world (#15756) 2024-10-10 18:47:04 +00:00
bevy_utils Minor fixes for bevy_utils in no_std (#15463) 2024-10-04 19:25:49 +00:00
bevy_window Add the functions start_drag_move and start_drag_resize to Window (#15674) 2024-10-08 16:32:07 +00:00
bevy_winit Rename App/World::observe to add_observer, EntityWorldMut::observe_entity to observe. (#15754) 2024-10-09 15:39:29 +00:00