mirror of
https://github.com/eyre-rs/eyre.git
synced 2025-09-27 04:50:50 +00:00

Warning: output filename collision appears in both stable and nightly builds. It's slightly more impactful than just a warning. Running cargo +nightly test, cargo test, cargo +nightly test in windows produces a linker error where color-spantrace tries to use eyre's usage.exe, see error 2 below. It's worked around pretty easily with cargo clean, but it's a problem that might get worse as the monorepo effort expands! This patch renames `usage.rs` to `CRATENAME-usage.rs`. Issue #115
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()
|
|
}
|