Don't include SpanTrace in Error debug

This commit is contained in:
Aode (lion) 2021-11-24 21:57:20 -06:00
parent 3912f1203d
commit 8b6d97fd4a
2 changed files with 7 additions and 2 deletions

View file

@ -9,12 +9,17 @@ use std::{convert::Infallible, fmt::Debug, io};
use tracing::error;
use tracing_error::SpanTrace;
#[derive(Debug)]
pub(crate) struct Error {
context: SpanTrace,
kind: ErrorKind,
}
impl std::fmt::Debug for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
writeln!(f, "{:?}", self.kind)
}
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
writeln!(f, "{}", self.kind)?;

View file

@ -37,7 +37,7 @@ fn init_subscriber(
let env_filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info"));
let format_layer = tracing_subscriber::fmt::layer()
.with_span_events(FmtSpan::NEW | FmtSpan::CLOSE)
.with_span_events(FmtSpan::CLOSE)
.pretty();
let subscriber = tracing_subscriber::Registry::default()