improve tracing

This commit is contained in:
nora 2022-03-07 15:15:47 +01:00
parent bd5d4c03c5
commit 08fa9163b8
14 changed files with 273 additions and 150 deletions

View file

@ -252,6 +252,7 @@ impl Debug for MaxFrameSize {
}
}
#[tracing::instrument(skip(w), level = "trace")]
pub async fn write_frame<W>(
mut w: W,
kind: FrameType,
@ -261,8 +262,6 @@ pub async fn write_frame<W>(
where
W: AsyncWriteExt + Unpin + Send,
{
trace!(?kind, ?channel, ?payload, "Sending frame");
w.write_u8(kind as u8).await?;
w.write_u16(channel.num()).await?;
w.write_u32(u32::try_from(payload.len()).context("frame size too big")?)