tracing-oslog sucks and crashes

This commit is contained in:
Christien Rioux 2024-06-23 15:14:32 -04:00
parent 2b1dd49138
commit 440195c267
3 changed files with 4 additions and 4 deletions

1
Cargo.lock generated
View File

@ -5981,7 +5981,6 @@ dependencies = [
"tokio-util", "tokio-util",
"tracing", "tracing",
"tracing-opentelemetry", "tracing-opentelemetry",
"tracing-oslog",
"tracing-subscriber", "tracing-subscriber",
"veilid-core", "veilid-core",
] ]

View File

@ -74,4 +74,3 @@ android_log-sys = { version = "0.3.1", optional = true }
# Dependencies for iOS builds only # Dependencies for iOS builds only
[target.'cfg(target_os = "ios")'.dependencies] [target.'cfg(target_os = "ios")'.dependencies]
oslog = { version = "0.2.0", default-features = false, optional = true } oslog = { version = "0.2.0", default-features = false, optional = true }
tracing-oslog = { version = "0.1.2" }

View File

@ -235,10 +235,12 @@ pub extern "C" fn initialize_veilid_core(platform_config: FfiStr) {
filters.insert("terminal", filter); filters.insert("terminal", filter);
layers.push(layer.boxed()); layers.push(layer.boxed());
} else if #[cfg(target_os = "ios")] { } else if #[cfg(target_os = "ios")] {
use tracing_oslog::OsLogger;
let filter = let filter =
veilid_core::VeilidLayerFilter::new(platform_config.logging.terminal.level, &platform_config.logging.terminal.ignore_log_targets); veilid_core::VeilidLayerFilter::new(platform_config.logging.terminal.level, &platform_config.logging.terminal.ignore_log_targets);
let layer = OsLogger::new("com.veilid.veilid-flutter", "default") let layer = tracing_subscriber::fmt::Layer::new()
.compact()
.with_ansi(false)
.with_writer(std::io::stdout)
.with_filter(filter.clone()); .with_filter(filter.clone());
filters.insert("terminal", filter); filters.insert("terminal", filter);
layers.push(layer.boxed()); layers.push(layer.boxed());