Skip to main content

Crate tiny_tracing

Crate tiny_tracing 

Source
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>> {
    Logger::new().init()?;

    tiny_tracing::info!("Application started");
    Ok(())
}

§Features

  • Text and JSON output formats
  • Environment-filter support via EnvFilter ("info,my_crate=debug", RUST_LOG, etc.)
  • Fluent builder API with sensible defaults
  • Safe initialisation — never panics on double-init

Re-exports§

pub use config::LogFormat;
pub use config::Logger;

Modules§

config
Logger builder and initialisation logic.
errors
Error types returned by the library.
time
Custom timestamp formatter for log lines.

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.