async fn collect_and_send_stdout(log_opt: LogOpt) -> Result<(), anyhow::Error> {
        if log_opt.stdout_socket.as_handle_ref().is_invalid() {
            return Ok(());
        }

        let mut stream = match StdoutStream::new(log_opt.stdout_socket) {
            Err(e) => {
                error!("Stdout Logger: Failed to create fuchsia async socket: {:?}", e);
                return Ok(());
            }
            Ok(stream) => stream,
        };
        let mut log_buffer = LogBuffer::new(
            log_opt.name,
            log_opt.buffering_duration,
            log_opt.sender,
            log_opt.buffer_size,
        );

        while let Some(log) = stream.try_next().await.context("Error reading stdout log msg")? {
            log_buffer.send_log(&log).await?;
        }
        log_buffer.done().await
    }
/// Internal method that put a listener on `stdout_socket`, process and send test stdout logs
/// asynchronously in the background. Returns immediately if the provided socket is an invalid
/// handle.
Internal method that put a listener on `stdout_socket`, process and send test stdout logs
asynchronously in the background. Returns immediately if the provided socket is an invalid
handle.
Internal method that put a listener on ` stdout_socket ` process and send test stdout logs asynchronously in the background . Returns immediately if the provided socket is an invalid handle .
async fn collect_and_send_stdout(log_opt: LogOpt) -> Result<(), anyhow::Error> {
        if log_opt.stdout_socket.as_handle_ref().is_invalid() {
            return Ok(());
        }
        let mut stream = match StdoutStream::new(log_opt.stdout_socket) {
            Err(e) => {
                error!("Stdout Logger: Failed to create fuchsia async socket: {:?}", e);
                return Ok(());
            }
            Ok(stream) => stream,
        };
        let mut log_buffer = LogBuffer::new(
            log_opt.name,
            log_opt.buffering_duration,
            log_opt.sender,
            log_opt.buffer_size,
        );
        while let Some(log) = stream.try_next().await.context("Error reading stdout log msg")? {
            log_buffer.send_log(&log).await?;
        }
        log_buffer.done().await
    }
async fn collect_and_send_stdout ( log_opt : LogOpt ) -> Result < ( ) , anyhow :: Error > { if log_opt . stdout_socket . as_handle_ref ( ) . is_invalid ( ) { return Ok ( ( ) ) ; } let mut stream = match StdoutStream :: new ( log_opt . stdout_socket ) { Err ( e ) => { error ! ( " " e ) ; return Ok ( ( ) ) ; } Ok ( stream ) => stream , } ; let mut log_buffer = LogBuffer :: new ( log_opt . name , log_opt . buffering_duration , log_opt . sender , log_opt . buffer_size , ) ; while let Some ( log ) = stream . try_next ( ) . await . context ( " " ) ? { log_buffer . send_log ( & log ) . await ? ; } log_buffer . done ( ) . await }
Internal method that put a listener on `stdout_socket`, process and send test stdout logs
asynchronously in the background.
Internal method that put a listener on ` stdout_socket ` process and send test stdout logs asynchronously in the background .
log_opt
LogOpt
log_opt
LogOpt