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//! - Environment-filter support via [`EnvFilter`](tracing_subscriber::EnvFilter)
26//!   (`"info,my_crate=debug"`, `RUST_LOG`, etc.)
27//! - Fluent builder API with sensible defaults
28//! - Safe initialisation — never panics on double-init
29
30#![deny(missing_docs)]
31
32/// Logger builder and initialisation logic.
33pub mod config;
34/// Error types returned by the library.
35pub mod errors;
36/// Custom timestamp formatter for log lines.
37pub mod time;
38
39pub use tracing::{Level, debug, error, info, trace, warn};
40
41pub use config::{LogFormat, Logger};