#android #logcat #tracing #logging #subscriber

paranoid-android

Integration layer between tracing and Android logs

4 releases

0.2.0 Apr 16, 2022
0.1.2 Dec 3, 2021
0.1.1 Dec 3, 2021
0.1.0 Dec 2, 2021

#199 in Debugging

Download history 1/week @ 2022-01-20 6/week @ 2022-01-27 4/week @ 2022-02-03 1/week @ 2022-02-10 3/week @ 2022-02-17 1/week @ 2022-02-24 6/week @ 2022-03-10 16/week @ 2022-03-17 3/week @ 2022-03-24 3/week @ 2022-04-07 32/week @ 2022-04-14 6/week @ 2022-04-21 37/week @ 2022-04-28 31/week @ 2022-05-05

106 downloads per month

MIT license

15KB
303 lines

paranoid-android

Integration layer between tracing and Android logs

Crates.io docs.rs

This crate provides a MakeWriter suitable for writing Android logs.

It is designed as an integration with the fmt subscriber from tracing-subscriber and as such inherits all of its features and customization options.


lib.rs:

Integration layer between tracing and Android logs.

This crate provides a MakeWriter suitable for writing Android logs.

It is designed as an integration with the fmt subscriber from tracing-subscriber and as such inherits all of its features and customization options.

Usage

paranoid_android::init(env!("CARGO_PKG_NAME"));

or with custom options and combined with other layers

# let other_layer = paranoid_android::layer("other");
#
use tracing_subscriber::filter::LevelFilter;
use tracing_subscriber::fmt::FmtSpan;
use tracing_subscriber::prelude::*;

let android_layer = paranoid_android::layer(env!("CARGO_PKG_NAME"))
    .with_span_events(FmtSpan::CLOSE)
    .with_thread_names(true)
    .with_filter(LevelFilter::DEBUG);

tracing_subcriber::registry()
    .with(android_layer)
    .with(other_layer)
    .init();

Cargo features

  • api-30: Enables support for Android API level 30 and source location information

Dependencies

~1.2–2MB
~40K SLoC