mirror of
https://github.com/eyre-rs/eyre.git
synced 2025-09-30 14:32:13 +00:00

git-subtree-dir: color-spantrace git-subtree-mainline: a443fd444ecfe8ac7f0d9a33b3f8e8d125eedbff git-subtree-split: 1a52aac2b55a05efc64807f06b91414550805af8
22 lines
430 B
Rust
22 lines
430 B
Rust
use tracing::instrument;
|
|
use tracing_error::{ErrorLayer, SpanTrace};
|
|
use tracing_subscriber::{prelude::*, registry::Registry};
|
|
|
|
#[instrument]
|
|
fn main() {
|
|
Registry::default().with(ErrorLayer::default()).init();
|
|
|
|
let span_trace = one(42);
|
|
println!("{}", color_spantrace::colorize(&span_trace));
|
|
}
|
|
|
|
#[instrument]
|
|
fn one(i: u32) -> SpanTrace {
|
|
two()
|
|
}
|
|
|
|
#[instrument]
|
|
fn two() -> SpanTrace {
|
|
SpanTrace::capture()
|
|
}
|