Use debug instead of println in devtools

This commit is contained in:
Manish Goregaokar 2016-05-27 15:09:26 +05:30
parent 4dcb05ca4f
commit 48257ef282
No known key found for this signature in database
GPG key ID: 3BBF4D3E2EF79F98
8 changed files with 17 additions and 11 deletions

View file

@ -20,7 +20,7 @@ pub trait JsonPacketStream {
impl JsonPacketStream for TcpStream {
fn write_json_packet<T: Serialize>(&mut self, obj: &T) {
let s = serde_json::to_string(obj).unwrap();
println!("<- {}", s);
debug!("<- {}", s);
write!(self, "{}:{}", s.len(), s).unwrap();
}
@ -48,7 +48,7 @@ impl JsonPacketStream for TcpStream {
};
let mut packet = String::new();
self.take(packet_len).read_to_string(&mut packet).unwrap();
println!("{}", packet);
debug!("{}", packet);
return match serde_json::from_str(&packet) {
Ok(json) => Ok(Some(json)),
Err(err) => match err {