Skip to content

Commit 24e59ca

Browse files
committed
Remove tracing due to issues with the log crate
1 parent ce2d81a commit 24e59ca

File tree

6 files changed

+1
-12
lines changed

6 files changed

+1
-12
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ name = "binance_async"
2323
path = "src/lib.rs"
2424

2525
[dependencies]
26-
tracing = "0.1.40"
26+
# tracing = "0.1.40"
2727
tungstenite = "0.24.0"
2828
tokio-tungstenite = { version = "0.24.0", features = ["native-tls"] }
2929
url = "2.5.2"

examples/endpoints.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use std::env::var;
77
async fn main() -> Result<()> {
88
dotenv::dotenv()?;
99
env_logger::init();
10-
tracing::subscriber::set_global_default(tracing_subscriber::FmtSubscriber::new()).unwrap();
1110

1211
let api_key = var("BINANCE_KEY")?;
1312
let secret_key = var("BINANCE_SECRET")?;

examples/new_endpoints.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ use std::env::var;
55

66
#[tokio::main]
77
async fn main() -> Result<()> {
8-
tracing::subscriber::set_global_default(tracing_subscriber::FmtSubscriber::new()).unwrap();
9-
108
let api_key = var("BINANCE_KEY")?;
119
let secret_key = var("BINANCE_SECRET")?;
1210

examples/ws.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ use futures::TryStreamExt;
66

77
#[tokio::main]
88
async fn main() -> Result<()> {
9-
tracing::subscriber::set_global_default(tracing_subscriber::FmtSubscriber::new()).unwrap();
10-
119
println!("Data Stream Started ...");
1210

1311
let mut ws = BinanceWebsocket::default();

src/client/websocket.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use std::{
1414
use streamunordered::{StreamUnordered, StreamYield};
1515
use tokio::net::TcpStream;
1616
use tokio_tungstenite::{connect_async, tungstenite::Message, MaybeTlsStream, WebSocketStream};
17-
use tracing::*;
1817

1918
const WS_URL: &str = "wss://stream.binance.com:9443/ws";
2019

@@ -48,8 +47,6 @@ impl BinanceWebsocket {
4847
Subscription::UserData(ref key) => key.clone(),
4948
};
5049

51-
trace!("[Websocket] Subscribing to '{:?}'", subscription);
52-
5350
let endpoint = format!("{}/{}", WS_URL, sub);
5451

5552
let token = self
@@ -102,7 +99,6 @@ fn parse_message(sub: &Subscription, msg: Message) -> Result<BinanceWebsocketMes
10299
Message::Frame(msg) => return Err(anyhow!("Unexpected frame: {:?}", msg)),
103100
};
104101

105-
trace!("Incoming websocket message {}", msg);
106102
let message = match sub {
107103
Subscription::AggregateTrade(..) => {
108104
BinanceWebsocketMessage::AggregateTrade(from_str(&msg)?)

src/transport.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use serde_json::{to_string, to_value, Value};
1212
use sha2::Sha256;
1313
use std::fmt;
1414
use std::str::FromStr;
15-
use tracing::*;
1615
use url::Url;
1716

1817
const BASE: &str = "https://www.binance.com/api";
@@ -303,7 +302,6 @@ impl Transport {
303302
// Signature: hex(HMAC_SHA256(queries + data))
304303
let mut mac = Hmac::<Sha256>::new_from_slice(secret.as_bytes()).unwrap();
305304
let sign_message = format!("{}{}", url.query().unwrap_or(""), body);
306-
trace!("Sign message: {}", sign_message);
307305
mac.update(sign_message.as_bytes());
308306
let signature = hexify(mac.finalize().into_bytes());
309307
Ok((key, signature))

0 commit comments

Comments
 (0)