Skip to content

Commit

Permalink
tone down all debug to trace
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis Thiery committed Nov 25, 2024
1 parent cffea95 commit 2357ad2
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1287,12 +1287,12 @@ async fn bind_connection<T>(io: &mut T) -> Result<(), crate::Error>
where
T: AsyncRead + AsyncWrite + Unpin,
{
tracing::debug!("binding client connection");
tracing::trace!("binding client connection");

let msg: &'static [u8] = b"PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n";
io.write_all(msg).await.map_err(crate::Error::from_io)?;

tracing::debug!("client connection bound");
tracing::trace!("client connection bound");

Ok(())
}
Expand Down
4 changes: 2 additions & 2 deletions src/codec/framed_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ fn decode_frame(
} else {
let cnt = partial.continuation_frames_count + 1;
if cnt > max_continuation_frames {
tracing::debug!("too_many_continuations, max = {}", max_continuation_frames);
tracing::trace!("too_many_continuations, max = {}", max_continuation_frames);
return Err(Error::library_go_away_data(
Reason::ENHANCE_YOUR_CALM,
"too_many_continuations",
Expand Down Expand Up @@ -401,7 +401,7 @@ where
partial,
bytes,
)? {
tracing::debug!(?frame, "received");
tracing::trace!(?frame, "received");
return Poll::Ready(Some(Ok(frame)));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/codec/framed_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ where
let span = tracing::trace_span!("FramedWrite::buffer", frame = ?item);
let _e = span.enter();

tracing::debug!(frame = ?item, "send");
tracing::trace!(frame = ?item, "send");

match item {
Frame::Data(mut v) => {
Expand Down
2 changes: 1 addition & 1 deletion src/frame/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl Settings {

// Ensure the payload length is correct, each setting is 6 bytes long.
if payload.len() % 6 != 0 {
tracing::debug!("invalid settings payload length; len={:?}", payload.len());
tracing::trace!("invalid settings payload length; len={:?}", payload.len());
return Err(Error::InvalidPayloadAckSettings);
}

Expand Down
2 changes: 1 addition & 1 deletion src/hpack/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ impl Decoder {
return Err(DecoderError::InvalidMaxDynamicSize);
}

tracing::debug!(
tracing::trace!(
from = self.table.size(),
to = new_size,
"Decoder changed max table size"
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@

macro_rules! proto_err {
(conn: $($msg:tt)+) => {
tracing::debug!("connection error PROTOCOL_ERROR -- {};", format_args!($($msg)+))
tracing::trace!("connection error PROTOCOL_ERROR -- {};", format_args!($($msg)+))
};
(stream: $($msg:tt)+) => {
tracing::debug!("stream error PROTOCOL_ERROR -- {};", format_args!($($msg)+))
tracing::trace!("stream error PROTOCOL_ERROR -- {};", format_args!($($msg)+))
};
}

Expand Down
6 changes: 3 additions & 3 deletions src/proto/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ where
ping_pong: PingPong::new(),
settings: Settings::new(config.settings),
streams,
span: tracing::debug_span!("Connection", peer = %P::NAME),
span: tracing::trace_span!("Connection", peer = %P::NAME),
_phantom: PhantomData,
},
}
Expand Down Expand Up @@ -432,7 +432,7 @@ where
// terminating the connection.
Err(Error::GoAway(debug_data, reason, initiator)) => {
let e = Error::GoAway(debug_data.clone(), reason, initiator);
tracing::debug!(error = ?e, "Connection::poll; connection error");
tracing::trace!(error = ?e, "Connection::poll; connection error");

// We may have already sent a GOAWAY for this error,
// if so, don't send another, just flush and close up.
Expand Down Expand Up @@ -465,7 +465,7 @@ where
//
// TODO: Are I/O errors recoverable?
Err(Error::Io(kind, inner)) => {
tracing::debug!(error = ?kind, "Connection::poll; IO error");
tracing::trace!(error = ?kind, "Connection::poll; IO error");
let e = Error::Io(kind, inner);

// Reset all active streams
Expand Down
2 changes: 1 addition & 1 deletion src/proto/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl Settings {
if frame.is_ack() {
match &self.local {
Local::WaitingAck(local) => {
tracing::debug!("received settings ACK; applying {:?}", local);
tracing::trace!("received settings ACK; applying {:?}", local);

if let Some(max) = local.max_frame_size() {
codec.set_max_recv_frame_size(max as usize);
Expand Down
8 changes: 4 additions & 4 deletions src/proto/streams/recv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl Recv {
// So, if peer is a server, we'll send a 431. In either case,
// an error is recorded, which will send a REFUSED_STREAM,
// since we don't want any of the data frames either.
tracing::debug!(
tracing::trace!(
"stream error REQUEST_HEADER_FIELDS_TOO_LARGE -- \
recv_headers: frame is over size; stream={:?}",
stream.id
Expand Down Expand Up @@ -699,7 +699,7 @@ impl Recv {

pub fn consume_connection_window(&mut self, sz: WindowSize) -> Result<(), Error> {
if self.flow.window_size() < sz {
tracing::debug!(
tracing::trace!(
"connection error FLOW_CONTROL_ERROR -- window_size ({:?}) < sz ({:?});",
self.flow.window_size(),
sz,
Expand Down Expand Up @@ -733,7 +733,7 @@ impl Recv {
// So, if peer is a server, we'll send a 431. In either case,
// an error is recorded, which will send a PROTOCOL_ERROR,
// since we don't want any of the data frames either.
tracing::debug!(
tracing::trace!(
"stream error PROTOCOL_ERROR -- recv_push_promise: \
headers frame is over size; promised_id={:?};",
frame.promised_id(),
Expand Down Expand Up @@ -780,7 +780,7 @@ impl Recv {
pub fn ensure_not_idle(&self, id: StreamId) -> Result<(), Reason> {
if let Ok(next) = self.next_stream_id {
if id >= next {
tracing::debug!(
tracing::trace!(
"stream ID implicitly closed, PROTOCOL_ERROR; stream={:?}",
id
);
Expand Down
6 changes: 3 additions & 3 deletions src/proto/streams/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ impl Send {
|| fields.contains_key("keep-alive")
|| fields.contains_key("proxy-connection")
{
tracing::debug!("illegal connection-specific headers found");
tracing::trace!("illegal connection-specific headers found");
return Err(UserError::MalformedHeaders);
} else if let Some(te) = fields.get(http::header::TE) {
if te != "trailers" {
tracing::debug!("illegal connection-specific headers found");
tracing::trace!("illegal connection-specific headers found");
return Err(UserError::MalformedHeaders);
}
}
Expand Down Expand Up @@ -375,7 +375,7 @@ impl Send {
task: &mut Option<Waker>,
) -> Result<(), Reason> {
if let Err(e) = self.prioritize.recv_stream_window_update(sz, stream) {
tracing::debug!("recv_stream_window_update !!; err={:?}", e);
tracing::trace!("recv_stream_window_update !!; err={:?}", e);

self.send_reset(
Reason::FLOW_CONTROL_ERROR,
Expand Down
4 changes: 2 additions & 2 deletions src/proto/streams/streams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ impl Inner {
// This may be response headers for a stream we've already
// forgotten about...
if self.actions.may_have_forgotten_stream(peer, id) {
tracing::debug!(
tracing::trace!(
"recv_headers for old stream={:?}, sending STREAM_CLOSED",
id,
);
Expand Down Expand Up @@ -555,7 +555,7 @@ impl Inner {
}

if self.actions.may_have_forgotten_stream(peer, id) {
tracing::debug!("recv_data for old stream={:?}, sending STREAM_CLOSED", id,);
tracing::trace!("recv_data for old stream={:?}, sending STREAM_CLOSED", id,);

let sz = frame.payload().len();
// This should have been enforced at the codec::FramedRead layer, so
Expand Down
6 changes: 3 additions & 3 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1454,12 +1454,12 @@ impl Peer {
if let Err(e) = frame::PushPromise::validate_request(&request) {
use PushPromiseHeaderError::*;
match e {
NotSafeAndCacheable => tracing::debug!(
NotSafeAndCacheable => tracing::trace!(
?promised_id,
"convert_push_message: method {} is not safe and cacheable",
request.method(),
),
InvalidContentLength(e) => tracing::debug!(
InvalidContentLength(e) => tracing::trace!(
?promised_id,
"convert_push_message; promised request has invalid content-length {:?}",
e,
Expand Down Expand Up @@ -1516,7 +1516,7 @@ impl proto::Peer for Peer {

macro_rules! malformed {
($($arg:tt)*) => {{
tracing::debug!($($arg)*);
tracing::trace!($($arg)*);
return Err(Error::library_reset(stream_id, Reason::PROTOCOL_ERROR));
}}
}
Expand Down

0 comments on commit 2357ad2

Please sign in to comment.