diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-10-16 00:54:29 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-10-16 00:54:29 -0400 |
commit | 64a56de257f7c40c683b941030e1c5e8afa8c7b6 (patch) | |
tree | 8c3bb29270227c3b8129dead1ae363ec3229081f /src | |
parent | 436c270260b3ba2ca7c7633c88435282e4c9b2b8 (diff) | |
download | teleterm-64a56de257f7c40c683b941030e1c5e8afa8c7b6.tar.gz teleterm-64a56de257f7c40c683b941030e1c5e8afa8c7b6.zip |
add a bit more debug logging to the client
Diffstat (limited to 'src')
-rw-r--r-- | src/client.rs | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/client.rs b/src/client.rs index a32c92a..1375159 100644 --- a/src/client.rs +++ b/src/client.rs @@ -439,7 +439,11 @@ impl<S: tokio::io::AsyncRead + tokio::io::AsyncWrite + Send + 'static> Ok(futures::Async::NotReady) => { return Ok(crate::component_future::Poll::NotReady); } - Err(..) => { + Err(e) => { + log::debug!( + "error while connecting, reconnecting: {}", + e + ); self.reconnect(); // not sending a disconnect event here because we never // actually connected, so it'd just be spammy @@ -449,6 +453,9 @@ impl<S: tokio::io::AsyncRead + tokio::io::AsyncWrite + Send + 'static> if self.has_seen_server_recently() { return Ok(crate::component_future::Poll::NothingToDo); } else { + log::debug!( + "haven't seen server in a while, reconnecting", + ); self.reconnect(); return Ok(crate::component_future::Poll::Event( Event::Disconnect, @@ -491,7 +498,11 @@ impl<S: tokio::io::AsyncRead + tokio::io::AsyncWrite + Send + 'static> } Ok(poll) } - Err(..) => { + Err(e) => { + log::debug!( + "error handling message, reconnecting: {}", + e + ); self.reconnect(); Ok(crate::component_future::Poll::Event( Event::Disconnect, @@ -502,7 +513,8 @@ impl<S: tokio::io::AsyncRead + tokio::io::AsyncWrite + Send + 'static> Ok(futures::Async::NotReady) => { Ok(crate::component_future::Poll::NotReady) } - Err(..) => { + Err(e) => { + log::debug!("error reading message, reconnecting: {}", e); self.reconnect(); Ok(crate::component_future::Poll::Event( Event::Disconnect, @@ -525,7 +537,11 @@ impl<S: tokio::io::AsyncRead + tokio::io::AsyncWrite + Send + 'static> Ok(futures::Async::NotReady) => { Ok(crate::component_future::Poll::NotReady) } - Err(..) => { + Err(e) => { + log::debug!( + "error processing message, reconnecting: {}", + e + ); self.reconnect(); Ok(crate::component_future::Poll::Event( Event::Disconnect, @@ -569,7 +585,8 @@ impl<S: tokio::io::AsyncRead + tokio::io::AsyncWrite + Send + 'static> Ok(futures::Async::NotReady) => { Ok(crate::component_future::Poll::NotReady) } - Err(..) => { + Err(e) => { + log::debug!("error writing message, reconnecting: {}", e); self.reconnect(); Ok(crate::component_future::Poll::Event( Event::Disconnect, |