Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android: add timestamp on the log #275

Closed
iwanbk opened this issue May 30, 2024 · 1 comment
Closed

android: add timestamp on the log #275

iwanbk opened this issue May 30, 2024 · 1 comment
Labels
type_feature New feature or request

Comments

@iwanbk
Copy link
Member

iwanbk commented May 30, 2024

There is currently no timestamp in the android log which will hep to debug connectivity issue.

Have tried this changes (and similar changes) with no result

diff --git a/mobile/src/lib.rs b/mobile/src/lib.rs
index f21b28a..d31d82d 100644
--- a/mobile/src/lib.rs
+++ b/mobile/src/lib.rs
@@ -13,12 +13,15 @@ use tokio::sync::{mpsc, Mutex};
 fn setup_logging() {
     use tracing::level_filters::LevelFilter;
     use tracing_subscriber::filter::Targets;
+    use tracing_subscriber::fmt;
+    use tracing_subscriber::fmt::time::ChronoLocal;
     use tracing_subscriber::layer::SubscriberExt;
     use tracing_subscriber::util::SubscriberInitExt;
     let targets = Targets::new()
         .with_default(LevelFilter::INFO)
         .with_target("mycelium::router", LevelFilter::WARN);
     tracing_subscriber::registry()
+        .with(fmt::layer().with_timer(ChronoLocal::default()))
         .with(tracing_android::layer("mycelium").expect("failed to setup logger"))
         .with(targets)
         .init();
@iwanbk
Copy link
Member Author

iwanbk commented Jun 11, 2024

There are currently 3 ways to get the log: vscode debug console, adb, and android studio.

adb and android studio already show the timestamp, so i think we don't need it.

@iwanbk iwanbk closed this as completed Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type_feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant