Skip to main content

tiny_tracing/
lib.rs

1//! # tiny-tracing
2//!
3//! A lightweight, builder-style logger for Rust projects that wraps
4//! [`tracing`] and [`tracing-subscriber`].
5//!
6//! Ideal for small to medium applications that want structured or
7//! text output with minimal ceremony.
8//!
9//! # Quick start
10//!
11//! ```rust
12//! use tiny_tracing::Logger;
13//!
14//! fn main() -> Result<(), Box<dyn std::error::Error>> {
15//!     Logger::new().init()?;
16//!
17//!     tiny_tracing::info!("Application started");
18//!     Ok(())
19//! }
20//! ```
21//!
22//! # Features
23//!
24//! - Text and JSON output formats
25//! - Output to stdout, stderr, a file, or stdout and a file at once
26//! - Environment-filter support via [`EnvFilter`](tracing_subscriber::EnvFilter)
27//!   (`"info,my_crate=debug"`), optionally read from `RUST_LOG`
28//! - Fluent builder API with sensible defaults
29//! - UTC RFC 3339 timestamps, which can be turned off
30//! - Safe initialisation — never panics on double-init
31
32#![deny(missing_docs)]
33
34/// Logger builder and initialisation logic.
35pub mod config;
36/// Error types returned by the library.
37pub mod errors;
38
39pub use tracing::{Level, debug, error, info, trace, warn};
40
41pub use config::{LogFormat, Logger, Output};