From 84473c002d30417c6e0efa7f62bd6ff7f62fe63b Mon Sep 17 00:00:00 2001 From: Darius Maitia Date: Mon, 23 Sep 2024 21:44:14 -0300 Subject: [PATCH] Android logging: pstore logs disabled --- zenoh-jni/src/logger.rs | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/zenoh-jni/src/logger.rs b/zenoh-jni/src/logger.rs index 73f5112c..e9b78aa8 100644 --- a/zenoh-jni/src/logger.rs +++ b/zenoh-jni/src/logger.rs @@ -43,11 +43,25 @@ pub extern "C" fn Java_io_zenoh_Logger_00024Companion_startLogsViaJNI( ) { || -> ZResult<()> { let log_level = parse_filter(&mut env, filter)?; - android_logd_logger::builder() - .parse_filters(log_level.as_str()) - .tag_target_strip() - .prepend_module(true) - .init(); + #[cfg(target_os = "android")] + { + android_logd_logger::builder() + .parse_filters(log_level.as_str()) + .tag_target_strip() + .prepend_module(true) + .pstore(false) + .init(); + } + + #[cfg(not(target_os = "android"))] + { + android_logd_logger::builder() + .parse_filters(log_level.as_str()) + .tag_target_strip() + .prepend_module(true) + .init(); + } + Ok(()) }() .unwrap_or_else(|err| throw_exception!(env, err))