diff --git a/crates/tor-ptmgr/src/ipc.rs b/crates/tor-ptmgr/src/ipc.rs index 2ba3f863f..597e8af9d 100644 --- a/crates/tor-ptmgr/src/ipc.rs +++ b/crates/tor-ptmgr/src/ipc.rs @@ -606,6 +606,14 @@ impl PluggableTransport { &self.cmethods } + /// Return a loggable identifier for this transport. + pub(crate) fn identifier(&self) -> &str { + match &self.inner { + Some(child) => &child.identifier, + None => "", + } + } + /// Get the next [`PtMessage`] from the running transport. It is recommended to call this /// in a loop once a PT has been launched, in order to forward log messages and find out about /// status updates. diff --git a/crates/tor-ptmgr/src/lib.rs b/crates/tor-ptmgr/src/lib.rs index 01b1cd26b..155f223b0 100644 --- a/crates/tor-ptmgr/src/lib.rs +++ b/crates/tor-ptmgr/src/lib.rs @@ -203,10 +203,10 @@ impl PtReactor { match result { Ok(m) => { // FIXME(eta): We should forward the Status messages onto API consumers. - debug!("PT {} message: {:?}", self.running[idx].binary_path.to_string_lossy(), m); + debug!("PT {} message: {:?}", self.running[idx].identifier(), m); }, Err(e) => { - warn!("PT {} quit: {:?}", self.running[idx].binary_path.to_string_lossy(), e); + warn!("PT {} quit: {:?}", self.running[idx].identifier(), e); let pt = self.running.remove(idx); self.remove_pt(pt); }