tracing_android/
lib.rs

1//! # tracing-android
2//!
3//! Composable tracing layer which logs to logcat using the [Android NDK]'s
4//! __android_log_write function. The provided tag will be capped at 23 bytes.
5//! Logging events resulting in messages longer than 4000 bytes will result in
6//! multiple log lines in logcat. This avoids running into logcat's truncation
7//! behaviour.
8//!
9//! [Android NDK]: https://developer.android.com/ndk/reference/group/logging#__android_log_write
10
11mod android;
12mod layer;
13
14/// Constructs a [`layer::Layer`] with the given `tag`.
15/// ```no_run
16/// // add the layer to an existing subscriber
17/// let subscriber = {
18///     use tracing_subscriber::layer::SubscriberExt;
19///     subscriber.with(tracing_android::layer("com.example").unwrap())
20/// }
21// // .. install the subscriber ..
22/// ```
23pub fn layer(tag: &str) -> std::io::Result<layer::Layer> {
24    layer::Layer::new(tag)
25}