From 5c981f51f8cd1ddfa5a47a749da5798deee5c434 Mon Sep 17 00:00:00 2001 From: Till Hoeppner Date: Sun, 28 Jun 2015 19:37:50 +0200 Subject: Move IO logging into client.rs --- src/client.rs | 10 ++++++---- src/message.rs | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/client.rs b/src/client.rs index d3a8542..339415b 100644 --- a/src/client.rs +++ b/src/client.rs @@ -157,8 +157,9 @@ impl OwnedClient { None => return Result(Err(IrscError::NotConnected)) }); - for line in reader.lines() { - let line = line.unwrap().parse(); + for raw_line in reader.lines() { + let line = raw_line.as_ref().unwrap().parse(); + info!("<< {}", raw_line.unwrap()); if let Ok(msg) = line { self.handle_event(&msg); @@ -187,8 +188,9 @@ impl OwnedClient { None => return Result(Err(IrscError::NotConnected)) }); - for line in reader.lines() { - let line = line.unwrap().parse(); + for raw_line in reader.lines() { + let line = raw_line.as_ref().unwrap().parse(); + info!("<< {}", raw_line.unwrap()); if let Ok(msg) = line { s.handle_event(&msg); diff --git a/src/message.rs b/src/message.rs index 8b897be..be52090 100644 --- a/src/message.rs +++ b/src/message.rs @@ -99,7 +99,6 @@ impl Message { impl FromStr for Message { type Err = IrscError; fn from_str(i: &str) -> Result { - info!("<< {}", i); let len = i.len(); // remember, bytes, not chars let mut s = 0; -- cgit v1.2.3