Skip to content

Commit

Permalink
Switch to using stdout logging on android
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRawMeatball committed Jun 7, 2021
1 parent e464c21 commit 668b6a2
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 114 deletions.
3 changes: 0 additions & 3 deletions crates/bevy_log/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ bevy_utils = { path = "../bevy_utils", version = "0.5.0" }
tracing-subscriber = {version = "0.2.15", features = ["registry"]}
tracing-chrome = { version = "0.3.0", optional = true }

[target.'cfg(target_os = "android")'.dependencies]
android_log-sys = "0.2.0"

[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1.6"
tracing-wasm = "0.2"
Expand Down
98 changes: 0 additions & 98 deletions crates/bevy_log/src/android_tracing.rs

This file was deleted.

14 changes: 1 addition & 13 deletions crates/bevy_log/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#[cfg(target_os = "android")]
mod android_tracing;

pub mod prelude {
#[doc(hidden)]
pub use bevy_utils::tracing::{
Expand All @@ -21,8 +18,6 @@ use tracing_subscriber::{prelude::*, registry::Registry, EnvFilter};
/// this plugin will setup a collector appropriate to your target platform:
/// * Using [`tracing-subscriber`](https://crates.io/crates/tracing-subscriber) by default,
/// logging to `stdout`.
/// * Using [`android_log-sys`](https://crates.io/crates/android_log-sys) on Android,
/// logging to Android logs.
/// * Using [`tracing-wasm`](https://crates.io/crates/tracing-wasm) in WASM, logging
/// to the browser console.
///
Expand Down Expand Up @@ -94,7 +89,7 @@ impl Plugin for LogPlugin {
.unwrap();
let subscriber = Registry::default().with(filter_layer);

#[cfg(all(not(target_arch = "wasm32"), not(target_os = "android")))]
#[cfg(not(target_arch = "wasm32"))]
{
let fmt_layer = tracing_subscriber::fmt::Layer::default();
let subscriber = subscriber.with(fmt_layer);
Expand Down Expand Up @@ -136,12 +131,5 @@ impl Plugin for LogPlugin {
bevy_utils::tracing::subscriber::set_global_default(subscriber)
.expect("Could not set global default tracing subscriber. If you've already set up a tracing subscriber, please disable LogPlugin from Bevy's DefaultPlugins");
}

#[cfg(target_os = "android")]
{
let subscriber = subscriber.with(android_tracing::AndroidLayer::default());
bevy_utils::tracing::subscriber::set_global_default(subscriber)
.expect("Could not set global default tracing subscriber. If you've already set up a tracing subscriber, please disable LogPlugin from Bevy's DefaultPlugins");
}
}
}

0 comments on commit 668b6a2

Please sign in to comment.