From ba41d1908961cd1e663599d12c134df0b15c3abe Mon Sep 17 00:00:00 2001 From: Austin Abell Date: Wed, 7 Apr 2021 14:42:10 -0400 Subject: [PATCH] Replace println usage in ws provider (#263) * Replace println usage in ws provider * fmt --- ethers-providers/src/transports/ws.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ethers-providers/src/transports/ws.rs b/ethers-providers/src/transports/ws.rs index dcfee335..b1cd37ce 100644 --- a/ethers-providers/src/transports/ws.rs +++ b/ethers-providers/src/transports/ws.rs @@ -25,6 +25,7 @@ use tokio_tungstenite::{ connect_async, tungstenite::{self, protocol::Message}, }; +use tracing::{error, warn}; /// A JSON-RPC Client over Websockets. /// @@ -223,22 +224,22 @@ where sender, } => { if self.pending.insert(id, sender).is_some() { - println!("Replacing a pending request with id {:?}", id); + warn!("Replacing a pending request with id {:?}", id); } if let Err(e) = self.ws.send(Message::Text(request)).await { - println!("WS connection error: {:?}", e); + error!("WS connection error: {:?}", e); self.pending.remove(&id); } } TransportMessage::Subscribe { id, sink } => { if self.subscriptions.insert(id, sink).is_some() { - println!("Replacing already-registered subscription with id {:?}", id); + warn!("Replacing already-registered subscription with id {:?}", id); } } TransportMessage::Unsubscribe { id } => { if self.subscriptions.remove(&id).is_none() { - println!( + warn!( "Unsubscribing from non-existent subscription with id {:?}", id );