Lock dep for Android builds only

This commit is contained in:
Arnab Chakraborty 2024-06-27 01:19:48 +05:30
parent ded1bae8e0
commit ebc78f442b
3 changed files with 8 additions and 6 deletions

View file

@ -62,7 +62,6 @@ tokio = "1.38"
tokio-stream = "0.1.15"
tokio-util = "0.7.11"
tracing = "0.1.40"
tracing-android = "0.2.0"
tracing-subscriber = "0.3.18"
tracing-test = "0.2.5"
uhlc = "0.6.0" # Must follow version used by specta

View file

@ -102,7 +102,6 @@ tokio = { workspace = true, features = [
tokio-stream = { workspace = true, features = ["fs"] }
tokio-util = { workspace = true, features = ["io"] }
tracing = { workspace = true }
tracing-android = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
uuid = { workspace = true, features = ["v4", "serde"] }
webp = { workspace = true }
@ -160,6 +159,9 @@ icrate = { version = "0.1.2", features = [
"Foundation_NSNumber",
] }
[target.'cfg(target_os = "android")'.dependencies]
tracing-android = "0.2.0"
[dev-dependencies]
# Workspace dependencies
globset = { workspace = true }

View file

@ -258,16 +258,14 @@ impl Node {
let registry = registry();
#[cfg(target_os = "android")]
let registry = registry.with(tracing_android::layer("com.spacedrive.app").unwrap());
let registry = registry
.with(
tracing_subscriber::fmt::layer()
.with_file(true)
.with_line_number(true)
.with_ansi(false)
// .with_writer(logfile)
.with_target(false)
.with_writer(logfile)
.with_filter(EnvFilter::from_default_env()),
)
.with(
@ -278,6 +276,9 @@ impl Node {
.with_filter(EnvFilter::from_default_env()),
);
#[cfg(target_os = "android")]
let registry = registry.with(tracing_android::layer("com.spacedrive.app").unwrap());
registry.init();
std::panic::set_hook(Box::new(move |panic| {