From 3b894b444d978b9604f8dbda2612a5d742d7c84d Mon Sep 17 00:00:00 2001 From: Allan Clements Date: Thu, 26 Sep 2024 22:33:28 -0500 Subject: [PATCH] Revert "Exploratory logging" This reverts commit 03c24febba8780a95e1c8477463355f0c9a78f83. --- gremlin-client/Cargo.toml | 1 - gremlin-client/src/aio/connection.rs | 15 --------------- 2 files changed, 16 deletions(-) diff --git a/gremlin-client/Cargo.toml b/gremlin-client/Cargo.toml index c8911b1d..e3b6dfa4 100644 --- a/gremlin-client/Cargo.toml +++ b/gremlin-client/Cargo.toml @@ -64,7 +64,6 @@ futures = { version = "0.3.1", optional = true} pin-project-lite = { version = "0.2", optional = true} tokio = { version = "1", optional=true, features = ["full"] } -log = "0.4.22" [dependencies.uuid] features = ["serde", "v4"] diff --git a/gremlin-client/src/aio/connection.rs b/gremlin-client/src/aio/connection.rs index 2e103520..a0f311e0 100644 --- a/gremlin-client/src/aio/connection.rs +++ b/gremlin-client/src/aio/connection.rs @@ -22,7 +22,6 @@ mod tokio_use { } use futures::TryFutureExt; -use log::{error, info, warn}; #[cfg(feature = "tokio-runtime")] use tokio_use::*; @@ -138,7 +137,6 @@ impl Conn { let url = url::Url::parse(&opts.websocket_url()).expect("failed to parse url"); let websocket_config = opts.websocket_options.as_ref().map(WebSocketConfig::from); - info!("Openning websocket connection"); #[cfg(feature = "async-std-runtime")] let (client, _) = { @@ -161,7 +159,6 @@ impl Conn { .await? }; - info!("Opened websocket connection"); let (sink, stream) = client.split(); let (sender, receiver) = channel(20); let requests = Arc::new(Mutex::new(HashMap::new())); @@ -187,7 +184,6 @@ impl Conn { .send(Cmd::Msg((sender, id, payload))) .await .map_err(|e| { - error!("Marking websocket connection invalid on send error"); self.valid = false; e })?; @@ -203,7 +199,6 @@ impl Conn { GremlinError::WebSocket(_) | GremlinError::WebSocketAsync(_) | GremlinError::WebSocketPoolAsync(_) => { - error!("Marking websocket connection invalid on received error"); self.valid = false; } _ => {} @@ -219,13 +214,11 @@ impl Conn { impl Drop for Conn { fn drop(&mut self) { - warn!("Websocket connection instance dropped"); send_shutdown(self); } } fn send_shutdown(conn: &mut Conn) { - warn!("Websocket connection instance shutting down channel"); conn.sender.close_channel(); } @@ -242,7 +235,6 @@ fn sender_loop( let mut guard = requests.lock().await; guard.insert(msg.1, msg.0); if let Err(e) = sink.send(Message::Binary(msg.2)).await { - error!("Sink sending error occured"); let mut sender = guard.remove(&msg.1).unwrap(); sender .send(Err(GremlinError::from(Arc::new(e)))) @@ -252,24 +244,20 @@ fn sender_loop( drop(guard); } Cmd::Pong(data) => { - info!("Sending Pong"); sink.send(Message::Pong(data)) .await .expect("Failed to send pong message."); } Cmd::Shutdown => { - warn!("Shuting down connection"); let mut guard = requests.lock().await; guard.clear(); } }, None => { - warn!("Sending loop breaking"); break; } } } - warn!("Sending loop closing sink"); let _ = sink.close().await; }); } @@ -285,7 +273,6 @@ fn receiver_loop( Some(Err(error)) => { let mut guard = requests.lock().await; let error = Arc::new(error); - error!("Receiver loop error"); for s in guard.values_mut() { match s.send(Err(error.clone().into())).await { Ok(_r) => {} @@ -319,13 +306,11 @@ fn receiver_loop( } } Message::Ping(data) => { - info!("Received Ping"); let _ = sender.send(Cmd::Pong(data)).await; } _ => {} }, None => { - warn!("Receiver loop breaking"); break; } }