mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-21 05:41:33 +00:00
Remove all target
s 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:
@ -243,7 +243,7 @@ fn read_stream_internal<T: AsyncRead, Buf: Array<Item = u8>>(
|
||||
substream_id,
|
||||
packet_type,
|
||||
} = MultiplexHeader::parse(header).map_err(|err| {
|
||||
debug!(target: "libp2p-mplex", "failed to parse header: {}", err);
|
||||
debug!("failed to parse header: {}", err);
|
||||
io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
format!("Error parsing header: {:?}", err),
|
||||
@ -282,10 +282,10 @@ fn read_stream_internal<T: AsyncRead, Buf: Array<Item = u8>>(
|
||||
}
|
||||
Err(error) => {
|
||||
return if let varint::Error(varint::ErrorKind::Io(inner), ..) = error {
|
||||
debug!(target: "libp2p-mplex", "failed to read header: {}", inner);
|
||||
debug!("failed to read header: {}", inner);
|
||||
Err(inner)
|
||||
} else {
|
||||
debug!(target: "libp2p-mplex", "failed to read header: {}", error);
|
||||
debug!("failed to read header: {}", error);
|
||||
Err(io::Error::new(io::ErrorKind::Other, error.description()))
|
||||
};
|
||||
}
|
||||
@ -298,10 +298,7 @@ fn read_stream_internal<T: AsyncRead, Buf: Array<Item = u8>>(
|
||||
use self::NextMultiplexState::*;
|
||||
|
||||
let body_len = varint_state.read(&mut lock.stream).map_err(|e| {
|
||||
debug!(target: "libp2p-mplex",
|
||||
"substream {}: failed to read body length: {}",
|
||||
next.substream_id(),
|
||||
e);
|
||||
debug!("substream {}: failed to read body length: {}", next.substream_id(), e);
|
||||
io::Error::new(io::ErrorKind::Other, "Error reading varint")
|
||||
})?;
|
||||
|
||||
@ -401,8 +398,7 @@ fn read_stream_internal<T: AsyncRead, Buf: Array<Item = u8>>(
|
||||
return on_block;
|
||||
}
|
||||
Err(other) => {
|
||||
debug!(target: "libp2p-mplex",
|
||||
"substream {}: failed to read new stream: {}",
|
||||
debug!("substream {}: failed to read new stream: {}",
|
||||
substream_id,
|
||||
other);
|
||||
lock.read_state = Some(NewStream {
|
||||
@ -469,8 +465,7 @@ fn read_stream_internal<T: AsyncRead, Buf: Array<Item = u8>>(
|
||||
return on_block;
|
||||
}
|
||||
Err(other) => {
|
||||
debug!(target: "libp2p-mplex",
|
||||
"substream {}: failed to read message body: {}",
|
||||
debug!("substream {}: failed to read message body: {}",
|
||||
substream_id,
|
||||
other);
|
||||
return Err(other);
|
||||
@ -520,8 +515,7 @@ fn read_stream_internal<T: AsyncRead, Buf: Array<Item = u8>>(
|
||||
return on_block;
|
||||
}
|
||||
Err(other) => {
|
||||
debug!(target: "libp2p-mplex",
|
||||
"substream {}: failed to read ignore bytes: {}",
|
||||
debug!("substream {}: failed to read ignore bytes: {}",
|
||||
substream_id,
|
||||
other);
|
||||
lock.read_state = Some(Ignore {
|
||||
|
@ -98,7 +98,7 @@ impl<T, Buf: Array> MultiplexShared<T, Buf> {
|
||||
}
|
||||
|
||||
pub fn open_stream(&mut self, id: u32) -> bool {
|
||||
trace!(target: "libp2p-mplex", "open stream {}", id);
|
||||
trace!("open stream {}", id);
|
||||
self.open_streams
|
||||
.entry(id)
|
||||
.or_insert(SubstreamMetadata::new_open())
|
||||
@ -106,7 +106,7 @@ impl<T, Buf: Array> MultiplexShared<T, Buf> {
|
||||
}
|
||||
|
||||
pub fn close_stream(&mut self, id: u32) {
|
||||
trace!(target: "libp2p-mplex", "close stream {}", id);
|
||||
trace!("close stream {}", id);
|
||||
self.open_streams.insert(id, SubstreamMetadata::Closed);
|
||||
}
|
||||
|
||||
|
@ -207,10 +207,7 @@ pub fn write_stream<Buf: circular_buffer::Array, T: AsyncWrite>(
|
||||
Err(Some(Body { size }))
|
||||
}
|
||||
Err(other) => {
|
||||
debug!(target: "libp2p-mplex",
|
||||
"substream {}: failed to write body: {}",
|
||||
id,
|
||||
other);
|
||||
debug!("substream {}: failed to write body: {}", id, other);
|
||||
return Err(other);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user