up_rs/utils/errors.rs
1//! Utilities for manipulating eyre errors.
2
3use std::fmt::Debug;
4
5/// Format an error into a nice way to show it in a log message.
6/// e.g.
7///
8/// ```text
9/// trace!("Action failed.{}", log_error(&e));
10/// ```
11pub fn log_error(e: &impl Debug) -> String {
12 format!("\n Error: {e:?}")
13}