From 16cff48fbd7c31bf5ab5593176b7a8bc38ebdd39 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sun, 8 Sep 2024 14:44:54 +1000 Subject: [PATCH] Add tracing to ::drop Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- src/native_mux_impl/session.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/native_mux_impl/session.rs b/src/native_mux_impl/session.rs index 1ee719f0a..5e7eb9aa8 100644 --- a/src/native_mux_impl/session.rs +++ b/src/native_mux_impl/session.rs @@ -105,6 +105,10 @@ impl Drop for Session { None => return, }; - let _ = shutdown_mux_master(&self.ctl); + let _res = shutdown_mux_master(&self.ctl); + #[cfg(feature = "tracing")] + if let Err(err) = _res { + tracing::error!("Failed to close ssh session: {}", err); + } } }