Skip to content

Commit

Permalink
feat: Log SSH commands
Browse files Browse the repository at this point in the history
  • Loading branch information
qrichert committed Jan 8, 2025
1 parent 11325c3 commit 9286fa8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/native_mux_impl/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ impl Command {

let cmd = NonZeroByteSlice::new(&self.cmd).ok_or(Error::InvalidCommand)?;

#[cfg(feature = "tracing")]
tracing::debug!(cmd = String::from_utf8_lossy(cmd.into_inner()).as_ref());

let session = Session::builder()
.cmd(Cow::Borrowed(cmd))
.subsystem(self.subsystem)
Expand Down
3 changes: 3 additions & 0 deletions src/process_impl/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ impl Command {
),
Error,
> {
#[cfg(feature = "tracing")]
tracing::debug!(cmd = ?self.builder.as_std());

let mut channel = self.builder.spawn().map_err(Error::Ssh)?;

let child_stdin = channel.stdin.take();
Expand Down

0 comments on commit 9286fa8

Please sign in to comment.