Replace println usage in ws provider (#263)
* Replace println usage in ws provider * fmt
This commit is contained in:
parent
2640757d8a
commit
ba41d19089
|
@ -25,6 +25,7 @@ use tokio_tungstenite::{
|
||||||
connect_async,
|
connect_async,
|
||||||
tungstenite::{self, protocol::Message},
|
tungstenite::{self, protocol::Message},
|
||||||
};
|
};
|
||||||
|
use tracing::{error, warn};
|
||||||
|
|
||||||
/// A JSON-RPC Client over Websockets.
|
/// A JSON-RPC Client over Websockets.
|
||||||
///
|
///
|
||||||
|
@ -223,22 +224,22 @@ where
|
||||||
sender,
|
sender,
|
||||||
} => {
|
} => {
|
||||||
if self.pending.insert(id, sender).is_some() {
|
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 {
|
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);
|
self.pending.remove(&id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TransportMessage::Subscribe { id, sink } => {
|
TransportMessage::Subscribe { id, sink } => {
|
||||||
if self.subscriptions.insert(id, sink).is_some() {
|
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 } => {
|
TransportMessage::Unsubscribe { id } => {
|
||||||
if self.subscriptions.remove(&id).is_none() {
|
if self.subscriptions.remove(&id).is_none() {
|
||||||
println!(
|
warn!(
|
||||||
"Unsubscribing from non-existent subscription with id {:?}",
|
"Unsubscribing from non-existent subscription with id {:?}",
|
||||||
id
|
id
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue