Compare commits
2 Commits
main
...
build/last
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9e0d8d212 | ||
|
|
4e0356ef37 |
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,6 @@ wzp-crypto = { workspace = true }
|
|||||||
wzp-transport = { workspace = true }
|
wzp-transport = { workspace = true }
|
||||||
tokio = { workspace = true }
|
tokio = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
tracing-subscriber = { workspace = true, features = ["env-filter"] }
|
|
||||||
bytes = { workspace = true }
|
bytes = { workspace = true }
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
@@ -28,7 +27,9 @@ libc = "0.2"
|
|||||||
jni = { version = "0.21", default-features = false }
|
jni = { version = "0.21", default-features = false }
|
||||||
rand = { workspace = true }
|
rand = { workspace = true }
|
||||||
rustls = { version = "0.23", default-features = false, features = ["ring"] }
|
rustls = { version = "0.23", default-features = false, features = ["ring"] }
|
||||||
tracing-android = "0.2"
|
android_logger = "0.14"
|
||||||
|
log = "0.4"
|
||||||
|
tracing-log = "0.2"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
cc = "1"
|
cc = "1"
|
||||||
|
|||||||
@@ -35,24 +35,17 @@ static INIT_LOGGING: Once = Once::new();
|
|||||||
/// Safe to call multiple times — only the first call takes effect.
|
/// Safe to call multiple times — only the first call takes effect.
|
||||||
fn init_logging() {
|
fn init_logging() {
|
||||||
INIT_LOGGING.call_once(|| {
|
INIT_LOGGING.call_once(|| {
|
||||||
// Wrap in catch_unwind — sharded_slab allocation inside
|
// Use android_logger directly — tracing_subscriber::registry() allocates
|
||||||
// tracing_subscriber::registry() can crash on some Android
|
// a sharded_slab which causes SIGSEGV on Android 16 MTE devices.
|
||||||
// devices if scudo malloc fails during early initialization.
|
// android_logger is lightweight and doesn't trigger scudo crashes.
|
||||||
let _ = std::panic::catch_unwind(|| {
|
let _ = std::panic::catch_unwind(|| {
|
||||||
use tracing_subscriber::layer::SubscriberExt;
|
android_logger::init_once(
|
||||||
use tracing_subscriber::util::SubscriberInitExt;
|
android_logger::Config::default()
|
||||||
use tracing_subscriber::EnvFilter;
|
.with_max_level(log::LevelFilter::Info)
|
||||||
if let Ok(layer) = tracing_android::layer("wzp_android") {
|
.with_tag("wzp"),
|
||||||
// Filter: INFO for our crates, WARN for everything else.
|
);
|
||||||
// The jni crate emits VERBOSE logs for every method lookup
|
// Bridge tracing → log so our tracing::info! macros work
|
||||||
// (~10 lines per JNI call, 100+ calls/sec) which floods logcat
|
let _ = tracing_log::LogTracer::init();
|
||||||
// and causes the system to kill the app.
|
|
||||||
let filter = EnvFilter::new("warn,wzp_android=info,wzp_proto=info,wzp_transport=info,wzp_codec=info,wzp_fec=info,wzp_crypto=info");
|
|
||||||
let _ = tracing_subscriber::registry()
|
|
||||||
.with(layer)
|
|
||||||
.with(filter)
|
|
||||||
.try_init();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user