Set logging to output to file as well
This commit is contained in:
@@ -5,11 +5,12 @@ use std::{
|
||||
|
||||
pub struct ShellAction {
|
||||
path: String,
|
||||
name: String,
|
||||
}
|
||||
|
||||
impl ShellAction {
|
||||
pub fn new(path: String) -> Self {
|
||||
Self { path }
|
||||
pub fn new(name: String, path: String) -> Self {
|
||||
Self { path, name }
|
||||
}
|
||||
|
||||
pub fn execute(self) -> anyhow::Result<()> {
|
||||
@@ -17,6 +18,7 @@ impl ShellAction {
|
||||
|
||||
log::info!(
|
||||
"
|
||||
|
||||
===
|
||||
Starting running shell action: {}
|
||||
===
|
||||
@@ -35,7 +37,7 @@ Starting running shell action: {}
|
||||
let stdout_reader = BufReader::new(stdout);
|
||||
let mut stdout_lines = stdout_reader.lines();
|
||||
while let Some(Ok(line)) = stdout_lines.next() {
|
||||
log::info!("{}", line)
|
||||
log::info!(process=log::as_display!(self.name); "{}", line)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +45,7 @@ Starting running shell action: {}
|
||||
|
||||
log::info!(
|
||||
"
|
||||
|
||||
===
|
||||
Finished running shell action
|
||||
===
|
||||
|
Reference in New Issue
Block a user