File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ pub(crate) fn list_dev(dev: &Utf8Path) -> Result<Device> {
9898 let mut devs: DevicesOutput = Command :: new ( "lsblk" )
9999 . args ( [ "-J" , "-b" , "-O" ] )
100100 . arg ( dev)
101+ . log_debug ( )
101102 . run_and_parse_json ( ) ?;
102103 for dev in devs. blockdevices . iter_mut ( ) {
103104 dev. backfill_missing ( ) ?;
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ use anyhow::{Context, Result};
77
88/// Helpers intended for [`std::process::Command`].
99pub trait CommandRunExt {
10+ fn log_debug ( & mut self ) -> & mut Self ;
1011 fn run ( & mut self ) -> Result < ( ) > ;
1112 /// Execute the child process, parsing its stdout as JSON.
1213 fn run_and_parse_json < T : serde:: de:: DeserializeOwned > ( & mut self ) -> Result < T > ;
@@ -68,9 +69,17 @@ impl CommandRunExt for Command {
6869 fn run ( & mut self ) -> Result < ( ) > {
6970 let stderr = tempfile:: tempfile ( ) ?;
7071 self . stderr ( stderr. try_clone ( ) ?) ;
72+ tracing:: trace!( "exec: {self:?}" ) ;
7173 self . status ( ) ?. check_status ( stderr)
7274 }
7375
76+ /// Output a debug-level log message with this command.
77+ fn log_debug ( & mut self ) -> & mut Self {
78+ tracing:: debug!( "exec: {self:?}" ) ;
79+ self
80+ }
81+
82+ /// Synchronously execute the child, and parse its stdout as JSON.
7483 fn run_and_parse_json < T : serde:: de:: DeserializeOwned > ( & mut self ) -> Result < T > {
7584 let mut stdout = tempfile:: tempfile ( ) ?;
7685 self . stdout ( stdout. try_clone ( ) ?) ;
You can’t perform that action at this time.
0 commit comments