Merge pull request #380 from matthiasbeyer/libimagutil/polish-trace_output
Make trace() output a bit nicer
This commit is contained in:
commit
9ff826e64e
1 changed files with 2 additions and 3 deletions
|
@ -55,7 +55,7 @@ fn print_trace_maxdepth(idx: u64, e: &Error, max: u64) -> Option<&Error> {
|
|||
} else {
|
||||
write!(stderr(), "\n").ok();
|
||||
}
|
||||
write!(stderr(), "Error {:>4} : {}", idx, e.description()).ok();
|
||||
write!(stderr(), "ERROR[{:>4}]: {}", idx, e.description()).ok();
|
||||
e.cause()
|
||||
}
|
||||
|
||||
|
@ -65,9 +65,8 @@ fn count_error_causes(e: &Error) -> u64 {
|
|||
}
|
||||
|
||||
fn print_trace_dbg(idx: u64, e: &Error) {
|
||||
debug!("Error {:>4} : {}", idx, e.description());
|
||||
debug!("ERROR[{:>4}]: {}", idx, e.description());
|
||||
if e.cause().is_some() {
|
||||
debug!(" -- caused by:");
|
||||
print_trace_dbg(idx + 1, e.cause().unwrap());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue