notmuch: log any stderr output

This commit is contained in:
Bill Thiede 2025-04-24 12:02:55 -07:00
parent e365ced7dd
commit b58556254e

View File

@ -214,9 +214,8 @@ use std::{
process::Command,
};
use log::{error, info};
use serde::{Deserialize, Serialize};
use tracing::instrument;
use tracing::{error, info, instrument, warn};
/// # Number of seconds since the Epoch
pub type UnixTime = isize;
@ -718,6 +717,13 @@ impl Notmuch {
cmd.args(args);
info!("{:?}", &cmd);
let out = cmd.output()?;
if !out.stderr.is_empty() {
warn!(
"{:?}: STDERR:\n{}",
&cmd,
String::from_utf8_lossy(&out.stderr)
);
}
Ok(out.stdout)
}
}