Expand description
§tiny-tracing
A lightweight, builder-style logger for Rust projects that wraps
tracing and [tracing-subscriber].
Ideal for small to medium applications that want structured or text output with minimal ceremony.
§Quick start
use tiny_tracing::Logger;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let _guard = Logger::new().init()?;
tiny_tracing::info!("Application started");
Ok(())
}§Features
- Text and JSON output formats
- Output to stdout, stderr, a file, or stdout and a file at once; file writes are
non-blocking (keep the
LoggerGuardreturned byinitalive) - Environment-filter support via
EnvFilter("info,my_crate=debug"), optionally read fromRUST_LOG - Fluent builder API with sensible defaults
- UTC RFC 3339 timestamps, which can be turned off
- Safe initialisation — never panics on double-init
Re-exports§
pub use config::LogFormat;pub use config::Logger;pub use config::LoggerGuard;pub use config::Output;
Modules§
Macros§
- debug
- Constructs an event at the debug level.
- error
- Constructs an event at the error level.
- info
- Constructs an event at the info level.
- trace
- Constructs an event at the trace level.
- warn
- Constructs an event at the warn level.
Structs§
- Level
- Describes the level of verbosity of a span or event.