mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-10-01 05:45:40 +00:00
Use tracing macros by fully-qualifying them
This commit is contained in:
parent
cc131ecf60
commit
142e5e2d3a
@ -8,7 +8,6 @@ use serde_json::Value;
|
|||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
use tokio::sync::watch;
|
use tokio::sync::watch;
|
||||||
use tokio_tungstenite::tungstenite;
|
use tokio_tungstenite::tungstenite;
|
||||||
use tracing::{error, trace};
|
|
||||||
|
|
||||||
pub async fn connect() -> Result<RateUpdateStream> {
|
pub async fn connect() -> Result<RateUpdateStream> {
|
||||||
let (rate_update, rate_update_receiver) = watch::channel(Err(Error::NotYetRetrieved));
|
let (rate_update, rate_update_receiver) = watch::channel(Err(Error::NotYetRetrieved));
|
||||||
@ -24,25 +23,26 @@ pub async fn connect() -> Result<RateUpdateStream> {
|
|||||||
Ok(tungstenite::Message::Text(msg)) => msg,
|
Ok(tungstenite::Message::Text(msg)) => msg,
|
||||||
Ok(tungstenite::Message::Close(close_frame)) => {
|
Ok(tungstenite::Message::Close(close_frame)) => {
|
||||||
if let Some(tungstenite::protocol::CloseFrame { code, reason }) = close_frame {
|
if let Some(tungstenite::protocol::CloseFrame { code, reason }) = close_frame {
|
||||||
error!(
|
tracing::error!(
|
||||||
"Kraken rate stream was closed with code {} and reason: {}",
|
"Kraken rate stream was closed with code {} and reason: {}",
|
||||||
code, reason
|
code,
|
||||||
|
reason
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
error!("Kraken rate stream was closed without code and reason");
|
tracing::error!("Kraken rate stream was closed without code and reason");
|
||||||
}
|
}
|
||||||
let _ = rate_update.send(Err(Error::ConnectionClosed));
|
let _ = rate_update.send(Err(Error::ConnectionClosed));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Ok(msg) => {
|
Ok(msg) => {
|
||||||
trace!(
|
tracing::trace!(
|
||||||
"Kraken rate stream returned non text message that will be ignored: {}",
|
"Kraken rate stream returned non text message that will be ignored: {}",
|
||||||
msg
|
msg
|
||||||
);
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
error!(%e, "Error when reading from Kraken rate stream");
|
tracing::error!(%e, "Error when reading from Kraken rate stream");
|
||||||
let _ = rate_update.send(Err(e.into()));
|
let _ = rate_update.send(Err(e.into()));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user