#android #logcat #tracing #logging #subscriber

paranoid-android

Integration layer between tracing and Android logs

5 releases

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

#292 in Debugging

Download history 12/week @ 2022-10-07 19/week @ 2022-10-14 15/week @ 2022-10-21 37/week @ 2022-10-28 31/week @ 2022-11-04 19/week @ 2022-11-11 15/week @ 2022-11-18 58/week @ 2022-11-25 22/week @ 2022-12-02 48/week @ 2022-12-09 24/week @ 2022-12-16 32/week @ 2022-12-23 21/week @ 2022-12-30 61/week @ 2023-01-06 56/week @ 2023-01-13 54/week @ 2023-01-20

210 downloads per month

MIT license

15KB
304 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
~43K SLoC