fn dump_log_to_stdout(server_type: ServerType, log_path: &Path) {
    use std::io::Read;

    let mut f = std::fs::File::open(log_path).expect("failed to open log file");
    let mut buffer = [0_u8; 8 * 1024];

    info!("****************");
    info!("Start {:?} TestServer Output", server_type);
    info!("****************");

    while let Ok(read) = f.read(&mut buffer) {
        if read == 0 {
            break;
        }
        if let Ok(str) = std::str::from_utf8(&buffer[..read]) {
            print!("{}", str);
        } else {
            info!(
                "\n\n-- ERROR IN TRANSFER -- please see {:?} for raw contents ---\n\n",
                log_path
            );
        }
    }

    info!("****************");
    info!("End {:?} TestServer Output", server_type);
    info!("****************");
}
/// Dumps the content of the log file to stdout
Dumps the content of the log file to stdout
Dumps the content of the log file to stdout
fn dump_log_to_stdout(server_type: ServerType, log_path: &Path) {
    use std::io::Read;
    let mut f = std::fs::File::open(log_path).expect("failed to open log file");
    let mut buffer = [0_u8; 8 * 1024];
    info!("****************");
    info!("Start {:?} TestServer Output", server_type);
    info!("****************");
    while let Ok(read) = f.read(&mut buffer) {
        if read == 0 {
            break;
        }
        if let Ok(str) = std::str::from_utf8(&buffer[..read]) {
            print!("{}", str);
        } else {
            info!(
                "\n\n-- ERROR IN TRANSFER -- please see {:?} for raw contents ---\n\n",
                log_path
            );
        }
    }
    info!("****************");
    info!("End {:?} TestServer Output", server_type);
    info!("****************");
}
fn dump_log_to_stdout ( server_type : ServerType , log_path : & Path ) { use std :: io :: Read ; let mut f = std :: fs :: File :: open ( log_path ) . expect ( " " ) ; let mut buffer = [ 0_u8 ; 8 * 1024 ] ; info ! ( " " ) ; info ! ( " " server_type ) ; info ! ( " " ) ; while let Ok ( read ) = f . read ( & mut buffer ) { if read == 0 { break ; } if let Ok ( str ) = std :: str :: from_utf8 ( & buffer [ .. read ] ) { print ! ( " " str ) ; } else { info ! ( " \n \n \n \n " log_path ) ; } } info ! ( " " ) ; info ! ( " " server_type ) ; info ! ( " " ) ; }
Dumps the content of the log file to stdout
Dumps the content of the log file to stdout
server_type
ServerType
log_path
&Path
server_type
ServerType
log_path
&Path