diff --git a/Cargo.toml b/Cargo.toml index 1f548f505c..bffdaf531a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -458,7 +458,7 @@ bytemuck = "1.7" bevy_render = { path = "crates/bevy_render", version = "0.15.0-dev", default-features = false } # Needed to poll Task examples futures-lite = "2.0.1" -async-std = "1.12" +async-std = "1.13" crossbeam-channel = "0.5.0" argh = "0.1.12" thiserror = "1.0" diff --git a/crates/bevy_ecs/Cargo.toml b/crates/bevy_ecs/Cargo.toml index b3939d9789..bcc075354f 100644 --- a/crates/bevy_ecs/Cargo.toml +++ b/crates/bevy_ecs/Cargo.toml @@ -28,7 +28,7 @@ bevy_ecs_macros = { path = "macros", version = "0.15.0-dev" } petgraph = "0.6" bitflags = "2.3" -concurrent-queue = "2.4.0" +concurrent-queue = "2.5.0" disqualified = "1.0" fixedbitset = "0.5" serde = { version = "1", optional = true, default-features = false } diff --git a/crates/bevy_log/Cargo.toml b/crates/bevy_log/Cargo.toml index d996a78221..173d13e6ba 100644 --- a/crates/bevy_log/Cargo.toml +++ b/crates/bevy_log/Cargo.toml @@ -36,6 +36,9 @@ android_log-sys = "0.3.0" [target.'cfg(target_arch = "wasm32")'.dependencies] tracing-wasm = "0.2.1" +[target.'cfg(target_os = "ios")'.dependencies] +tracing-oslog = "0.2" + [lints] workspace = true diff --git a/crates/bevy_log/src/lib.rs b/crates/bevy_log/src/lib.rs index 32bdb9a122..118040f10f 100644 --- a/crates/bevy_log/src/lib.rs +++ b/crates/bevy_log/src/lib.rs @@ -227,7 +227,11 @@ impl Plugin for LogPlugin { #[cfg(feature = "trace")] let subscriber = subscriber.with(tracing_error::ErrorLayer::default()); - #[cfg(all(not(target_arch = "wasm32"), not(target_os = "android")))] + #[cfg(all( + not(target_arch = "wasm32"), + not(target_os = "android"), + not(target_os = "ios") + ))] { #[cfg(feature = "tracing-chrome")] let chrome_layer = { @@ -290,6 +294,11 @@ impl Plugin for LogPlugin { finished_subscriber = subscriber.with(android_tracing::AndroidLayer::default()); } + #[cfg(target_os = "ios")] + { + finished_subscriber = subscriber.with(tracing_oslog::OsLogger::default()); + } + let logger_already_set = LogTracer::init().is_err(); let subscriber_already_set = bevy_utils::tracing::subscriber::set_global_default(finished_subscriber).is_err(); diff --git a/examples/mobile/src/lib.rs b/examples/mobile/src/lib.rs index 505981167b..511e50ad59 100644 --- a/examples/mobile/src/lib.rs +++ b/examples/mobile/src/lib.rs @@ -3,6 +3,7 @@ use bevy::{ color::palettes::basic::*, input::{gestures::RotationGesture, touch::TouchPhase}, + log::{Level, LogPlugin}, prelude::*, window::{AppLifecycle, WindowMode}, }; @@ -11,17 +12,26 @@ use bevy::{ #[bevy_main] fn main() { let mut app = App::new(); - app.add_plugins(DefaultPlugins.set(WindowPlugin { - primary_window: Some(Window { - resizable: false, - mode: WindowMode::BorderlessFullscreen(MonitorSelection::Primary), - // on iOS, gestures must be enabled. - // This doesn't work on Android - recognize_rotation_gesture: true, - ..default() - }), - ..default() - })) + app.add_plugins( + DefaultPlugins + .set(LogPlugin { + // This will show some log events from Bevy to the native logger. + level: Level::DEBUG, + filter: "wgpu=error,bevy_render=info,bevy_ecs=trace".to_string(), + ..Default::default() + }) + .set(WindowPlugin { + primary_window: Some(Window { + resizable: false, + mode: WindowMode::BorderlessFullscreen(MonitorSelection::Primary), + // on iOS, gestures must be enabled. + // This doesn't work on Android + recognize_rotation_gesture: true, + ..default() + }), + ..default() + }), + ) .add_systems(Startup, (setup_scene, setup_music)) .add_systems(Update, (touch_camera, button_handler, handle_lifetime)) .run();