From deeccb9f608e83246b2215e0b90da8c012573f50 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 28 Jul 2020 16:40:00 +0600 Subject: [PATCH] more logging --- ntex-codec/src/bcodec.rs | 2 +- ntex/src/util/framed.rs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ntex-codec/src/bcodec.rs b/ntex-codec/src/bcodec.rs index f216ecc4..fc2ef292 100644 --- a/ntex-codec/src/bcodec.rs +++ b/ntex-codec/src/bcodec.rs @@ -1,4 +1,4 @@ -use bytes::{Bytes, BytesMut, Buf}; +use bytes::{Buf, Bytes, BytesMut}; use std::io; use super::{Decoder, Encoder}; diff --git a/ntex/src/util/framed.rs b/ntex/src/util/framed.rs index 0318882a..983e49a0 100644 --- a/ntex/src/util/framed.rs +++ b/ntex/src/util/framed.rs @@ -221,6 +221,7 @@ where let item = match self.framed.next_item(cx) { Poll::Ready(Some(Ok(el))) => el, Poll::Ready(Some(Err(err))) => { + log::trace!("Framed decode error"); self.state = FramedState::Shutdown(Some( DispatcherError::Decoder(err), )); @@ -261,6 +262,7 @@ where match Pin::new(&mut self.rx).poll_next(cx) { Poll::Ready(Some(Ok(msg))) => { if let Err(err) = self.framed.write(msg) { + log::trace!("Framed write error: {:?}", err); self.state = FramedState::Shutdown(Some( DispatcherError::Encoder(err), )); @@ -281,6 +283,7 @@ where match Pin::new(sink).poll_next(cx) { Poll::Ready(Some(msg)) => { if let Err(err) = self.framed.write(msg) { + log::trace!("Framed write error from sink: {:?}", err); self.state = FramedState::Shutdown(Some( DispatcherError::Encoder(err), )); @@ -337,6 +340,7 @@ where match Pin::new(&mut self.rx).poll_next(cx) { Poll::Ready(Some(Ok(msg))) => { if let Err(err) = self.framed.write(msg) { + log::trace!("Framed write message error: {:?}", err); self.state = FramedState::Shutdown(Some( DispatcherError::Encoder(err), )); @@ -344,6 +348,7 @@ where } } Poll::Ready(Some(Err(err))) => { + log::trace!("Sink poll error"); self.state = FramedState::Shutdown(Some(err.into())); continue; } @@ -360,6 +365,7 @@ where Poll::Ready(_) => (), } }; + log::trace!("Framed flushed, shutdown"); self.state = FramedState::Shutdown(err.take()); } FramedState::Shutdown(ref mut err) => {