fn log_error_chain(err_chain: anyhow::Error) {
    let mut chain_iter = err_chain.chain();
    let top_err = match chain_iter.next() {
        Some(e) => e.to_string(),
        None => "(unspecified failure)".to_string(),
    };
    log::error!("critical error: {}", top_err);
    for err in chain_iter {
        log::error!(" -> {}", err);
    }
}
/// Pretty-print a chain of errors, as a series of error-priority log messages.
Pretty-print a chain of errors, as a series of error-priority log messages.
Pretty - print a chain of errors as a series of error - priority log messages .
fn log_error_chain(err_chain: anyhow::Error) {
    let mut chain_iter = err_chain.chain();
    let top_err = match chain_iter.next() {
        Some(e) => e.to_string(),
        None => "(unspecified failure)".to_string(),
    };
    log::error!("critical error: {}", top_err);
    for err in chain_iter {
        log::error!(" -> {}", err);
    }
}
fn log_error_chain ( err_chain : anyhow :: Error ) { let mut chain_iter = err_chain . chain ( ) ; let top_err = match chain_iter . next ( ) { Some ( e ) => e . to_string ( ) , None => " " . to_string ( ) , } ; log :: error ! ( " " top_err ) ; for err in chain_iter { log :: error ! ( " " err ) ; } }
Pretty-print a chain of errors, as a series of error-priority log messages.
Pretty - print a chain of errors as a series of error - priority log messages .
err_chain
anyhow::Error