ptmgr: Use PluggableTransport::identity in logs.
This lets us avoid logging the user's path.
This commit is contained in:
parent
bb0749cd42
commit
f6311c83f7
|
@ -606,6 +606,14 @@ impl PluggableTransport {
|
||||||
&self.cmethods
|
&self.cmethods
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Return a loggable identifier for this transport.
|
||||||
|
pub(crate) fn identifier(&self) -> &str {
|
||||||
|
match &self.inner {
|
||||||
|
Some(child) => &child.identifier,
|
||||||
|
None => "<not yet launched>",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Get the next [`PtMessage`] from the running transport. It is recommended to call this
|
/// 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
|
/// in a loop once a PT has been launched, in order to forward log messages and find out about
|
||||||
/// status updates.
|
/// status updates.
|
||||||
|
|
|
@ -203,10 +203,10 @@ impl<R: Runtime> PtReactor<R> {
|
||||||
match result {
|
match result {
|
||||||
Ok(m) => {
|
Ok(m) => {
|
||||||
// FIXME(eta): We should forward the Status messages onto API consumers.
|
// 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) => {
|
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);
|
let pt = self.running.remove(idx);
|
||||||
self.remove_pt(pt);
|
self.remove_pt(pt);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue