refactor(all): adjust some logging
This commit is contained in:
		| @@ -53,11 +53,13 @@ impl<R: Read> BufReader<R> { | ||||
|     pub fn read_into_buf(&mut self) -> io::Result<usize> { | ||||
|         self.maybe_reserve(); | ||||
|         let v = &mut self.buf; | ||||
|         trace!("read_into_buf pos={}, cap={}", self.cap, v.capacity()); | ||||
|         if self.cap < v.capacity() { | ||||
|             let nread = try!(self.inner.read(&mut v[self.cap..])); | ||||
|             self.cap += nread; | ||||
|             Ok(nread) | ||||
|         } else { | ||||
|             trace!("read_into_buf at full capacity"); | ||||
|             Ok(0) | ||||
|         } | ||||
|     } | ||||
|   | ||||
| @@ -237,7 +237,7 @@ impl<'a, U: IntoUrl> RequestBuilder<'a, U> { | ||||
|             if res.status.class() != Redirection { | ||||
|                 return Ok(res) | ||||
|             } | ||||
|             debug!("redirect code {:?} for {:?}", res.status, url); | ||||
|             debug!("redirect code {:?} for {}", res.status, url); | ||||
|  | ||||
|             let loc = { | ||||
|                 // punching borrowck here | ||||
| @@ -257,9 +257,7 @@ impl<'a, U: IntoUrl> RequestBuilder<'a, U> { | ||||
|                 } | ||||
|             }; | ||||
|             url = match loc { | ||||
|                 Ok(u) => { | ||||
|                     inspect!("Location", u) | ||||
|                 }, | ||||
|                 Ok(u) => u, | ||||
|                 Err(e) => { | ||||
|                     debug!("Location header had invalid URI: {:?}", e); | ||||
|                     return Ok(res); | ||||
|   | ||||
| @@ -104,6 +104,7 @@ impl<C: NetworkConnector<Stream=S>, S: NetworkStream + Send> NetworkConnector fo | ||||
|         let mut should_remove = false; | ||||
|         let conn = match locked.conns.get_mut(&key) { | ||||
|             Some(ref mut vec) => { | ||||
|                 trace!("Pool had connection, using"); | ||||
|                 should_remove = vec.len() == 1; | ||||
|                 vec.pop().unwrap() | ||||
|             } | ||||
|   | ||||
| @@ -32,6 +32,7 @@ impl Response { | ||||
|  | ||||
|     /// Creates a new response from a server. | ||||
|     pub fn new(stream: Box<NetworkStream + Send>) -> ::Result<Response> { | ||||
|         trace!("Response::new"); | ||||
|         let mut stream = BufReader::new(stream); | ||||
|  | ||||
|         let head = try!(http::parse_response(&mut stream)); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user