/// Processes the file and logs any errors with the given logger.
/// The standard output and error streams of the child process are captured
/// and logged in case of a non-zero exit code.
Processes the file and logs any errors with the given logger.
The standard output and error streams of the child process are captured
and logged in case of a non-zero exit code.
Processes the file and logs any errors with the given logger . The standard output and error streams of the child process are captured and logged in case of a non - zero exit code .
pub fn run_or_log_err(&self, input: &Path, log: &Log) -> Option<(FileLen, FileHash)> {
        let result = self.run(input);
        match result {
            Err(e) => {
                log.err(format!("Failed to execute {}: {}", self.program, e));
                None
            }
            Ok(result) if !result.status.success() => {
                log.err(format!(
                    "Failed to transform {}: {} returned non-zero status code: {}{}",
                    input,
                    self.program,
                    result.status.code().unwrap(),
                    Self::format_output_stream(result.stderr.as_str(), "STDERR")
                ));
                None
            }
            Ok(result) => Some((result.output_len, result.output_hash)),
        }
    }
pub fn run_or_log_err ( & self , input : & Path , log : & Log ) -> Option < ( FileLen , FileHash ) > { let result = self . run ( input ) ; match result { Err ( e ) => { log . err ( format ! ( " " self program e ) ) ; None } Ok ( result ) if ! result . status . success ( ) => { log . err ( format ! ( " " input self program result status code ( ) unwrap ( ) Self format_output_stream ( result stderr as_str ( ) " " ) ) ) ; None } Ok ( result ) => Some ( ( result . output_len , result . output_hash ) ) , } }
Processes the file and logs any errors with the given logger.
Processes the file and logs any errors with the given logger .
&self
input
&Path
log
&Log