Skip to main content

tracing_os_layer/
lib.rs

1#![doc = include_str!("../README.md")]
2
3//! # Platform dispatch
4//!
5//! [`OsLogLayer`] is a different concrete type on each platform,
6//! selected at compile time. The public API is identical:
7//!
8//! ```
9//! use tracing_os_layer::OsLogLayer;
10//!
11//! let _layer = OsLogLayer::try_new("com.example.app", "worker");
12//! ```
13
14#[cfg(target_vendor = "apple")]
15mod macos;
16#[cfg(target_vendor = "apple")]
17pub use macos::OsLogLayer;
18
19#[cfg(target_os = "linux")]
20mod linux;
21#[cfg(target_os = "linux")]
22pub use linux::OsLogLayer;
23
24#[cfg(target_os = "windows")]
25mod windows;
26#[cfg(target_os = "windows")]
27pub use windows::OsLogLayer;
28
29#[cfg(not(any(target_vendor = "apple", target_os = "linux", target_os = "windows")))]
30mod stub;
31#[cfg(not(any(target_vendor = "apple", target_os = "linux", target_os = "windows")))]
32pub use stub::OsLogLayer;