mirror of
https://github.com/eyre-rs/eyre.git
synced 2025-09-30 06:21:52 +00:00
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()
|
|
}
|