Remove all targets from log statements. (#195)

The default uses crate + module path anyway, so `target` has been
redundant, causes more work when renaming crates and makes log
lines longer.
This commit is contained in:
Toralf Wittner
2018-05-17 15:14:13 +02:00
committed by GitHub
parent cb800624f5
commit 86a21fc43e
22 changed files with 158 additions and 217 deletions

View File

@ -85,7 +85,7 @@ where
let req = DialerToListenerMessage::ProtocolRequest {
name: proto_name.clone()
};
trace!(target: "multistream-select", "sending {:?}", req);
trace!("sending {:?}", req);
dialer.send(req)
.map(|d| (d, proto_name, proto_value))
.from_err()
@ -99,7 +99,7 @@ where
})
// Once read, analyze the response.
.and_then(|(message, rest, proto_name, proto_value)| {
trace!(target: "multistream-select", "received {:?}", message);
trace!("received {:?}", message);
let message = message.ok_or(ProtocolChoiceError::UnexpectedMessage)?;
match message {
@ -140,14 +140,14 @@ where
let future = Dialer::new(inner)
.from_err()
.and_then(move |dialer| {
trace!(target: "multistream-select", "requesting protocols list");
trace!("requesting protocols list");
dialer
.send(DialerToListenerMessage::ProtocolsListRequest)
.from_err()
})
.and_then(move |dialer| dialer.into_future().map_err(|(e, _)| e.into()))
.and_then(move |(msg, dialer)| {
trace!(target: "multistream-select", "protocols list response: {:?}", msg);
trace!("protocols list response: {:?}", msg);
let list = match msg {
Some(ListenerToDialerMessage::ProtocolsListResponse { list }) => list,
_ => return Err(ProtocolChoiceError::UnexpectedMessage),
@ -171,7 +171,7 @@ where
Ok((proto_name, proto_val, dialer))
})
.and_then(|(proto_name, proto_val, dialer)| {
trace!(target: "multistream-select", "sending {:?}", proto_name);
trace!("sending {:?}", proto_name);
dialer
.send(DialerToListenerMessage::ProtocolRequest {
name: proto_name.clone(),
@ -186,7 +186,7 @@ where
.map_err(|(err, _)| err.into())
})
.and_then(|(proto_name, proto_val, msg, dialer)| {
trace!(target: "multistream-select", "received {:?}", msg);
trace!("received {:?}", msg);
match msg {
Some(ListenerToDialerMessage::ProtocolAck { ref name }) if name == &proto_name => {
Ok((proto_val, dialer.into_inner()))

View File

@ -68,7 +68,7 @@ where
let msg = ListenerToDialerMessage::ProtocolsListResponse {
list: protocols.map(|(p, _, _)| p).collect(),
};
trace!(target: "multistream-select", "protocols list response: {:?}", msg);
trace!("protocols list response: {:?}", msg);
let fut = listener
.send(msg)
.from_err()
@ -86,10 +86,7 @@ where
break;
}
}
trace!(target: "multistream-select",
"requested: {:?}, response: {:?}",
name,
send_back);
trace!("requested: {:?}, response: {:?}", name, send_back);
let fut = listener
.send(send_back)
.from_err()
@ -97,7 +94,7 @@ where
Box::new(fut) as Box<Future<Item = _, Error = ProtocolChoiceError>>
}
None => {
debug!(target: "multistream-select", "no protocol request received");
debug!("no protocol request received");
Box::new(err(ProtocolChoiceError::NoProtocolFound)) as Box<_>
}
})

View File

@ -58,7 +58,7 @@ where
.map_err(|(e, _)| e.into())
.and_then(|(msg, rest)| {
if msg.as_ref().map(|b| &b[..]) != Some(MULTISTREAM_PROTOCOL_WITH_LF) {
debug!(target: "multistream-select", "failed handshake; received: {:?}", msg);
debug!("failed handshake; received: {:?}", msg);
return Err(MultistreamSelectError::FailedHandshake);
}
Ok(rest)
@ -93,7 +93,7 @@ where
match item {
ListenerToDialerMessage::ProtocolAck { name } => {
if !name.starts_with(b"/") {
debug!(target: "multistream-select", "invalid protocol name {:?}", name);
debug!("invalid protocol name {:?}", name);
return Err(MultistreamSelectError::WrongProtocolName);
}
let mut protocol = BytesMut::from(name);