From badc42a7e2b8f217654ee4740e40b62c21c6e6eb Mon Sep 17 00:00:00 2001 From: dece Date: Wed, 24 Nov 2021 18:17:53 +0100 Subject: [PATCH] get_response: print process stderr as warnings --- src/main.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 7b13ae6..141be73 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,7 @@ use std::thread; extern crate clap; use chrono::offset::TimeZone; -use log::{debug, error, info}; +use log::{debug, error, info, warn}; use openssl::{asn1, ssl, x509}; /// General CGI configuration. @@ -346,6 +346,17 @@ fn get_response( cgi_error.to_owned() })?; + if output.stderr.len() > 0 { + warn!("Process standard error:"); + if let Ok(stderr) = std::str::from_utf8(output.stderr.as_slice()) { + for line in stderr.lines() { + warn!(" {}", line); + } + } else { + error!("Can't decode process standard error.") + } + } + Ok((url_str.to_string(), output.stdout)) }