Crate paranoid_android
source ·Expand description
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
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
Structs§
- A
MakeWriter
suitable for writing Android logs. - The writer produced by
AndroidLogMakeWriter
.
Enums§
Functions§
- Creates a
Subscriber
with the given tag and attempts to set it as the global default subscriber in the current scope, panicking if this fails. - Returns a new formatting layer with the given tag, which can be composed with other layers to construct a
Subscriber
. - Returns a new formatting layer with the given tag and using the given Android log buffer, which can be composed with other layers to construct a
Subscriber
.
Type Aliases§
- A
Layer
that writes formatted representations oftracing
events as Android logs.