itrace 0.1.0

A configurable **columnar terminal tracer** for Rust.
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 5.43 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 233.62 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 21s Average build duration of successful builds.
  • all releases: 17s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • iclac/itrace
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • iclac

itrace

Crates.io Docs.rs Rust License

A configurable columnar terminal tracer for Rust.

Scope note — this crate was built for personal use in my own projects. It has no ambition to become a widely adopted library: there are far more mature and feature-rich crates in the Rust ecosystem for structured logging (e.g. [tracing], [log], [env_logger]). Maintenance is best-effort. That said, you are of course welcome to use it if it fits your needs.

Define any number of named columns with individual ANSI colours and widths using the #[itracer] proc-macro attribute. A typed entry-builder is generated automatically — one method per column — so call sites are concise and refactor-safe. Optionally integrates with [tracing_subscriber] as a drop-in event formatter (feature tracing). Log levels and colours can be tuned at runtime without recompiling via a TOML file in ~/.config/itrace/ (feature tracer-file).

Output format

 I  14:49:55.743834Z     myapp      eu-west-1    node-01    Server started
 ^  └──────────────┘  └─────────┘  └─────────┘  └───────┘  └────────────┘
 │      timestamp       col 1        col 2         col 3       message
 │
 └─ level badge (1 char, coloured background)
    I = green   W = orange   E = red   D = blue   T = pink
  • The level badge and timestamp are always present.
  • All other columns are user-defined.
  • Columns whose value is not supplied render as blank spaces, preserving alignment of the columns that follow.
  • Extra key=value pairs can be appended after the message.

Quick start

Add to Cargo.toml:

[dependencies]
itrace = { version = "0.1", features = ["derive"] }

... TODO!

Minimum Supported Rust Version

1.85 (Rust 2024 edition).

License

Licensed under the BSD 3-Clause license.