From ba6d33b081ca40ff9a4c7a1a0574cc6f1201697f Mon Sep 17 00:00:00 2001 From: Adam <24621027+adoyle0@users.noreply.github.com> Date: Fri, 2 Aug 2024 02:41:42 -0400 Subject: [PATCH] cleanup --- server/src/api.rs | 10 ---------- server/src/api/message_handler.rs | 20 ++------------------ server/src/main.rs | 2 +- 3 files changed, 3 insertions(+), 29 deletions(-) diff --git a/server/src/api.rs b/server/src/api.rs index 2316d7c..4c52d56 100644 --- a/server/src/api.rs +++ b/server/src/api.rs @@ -74,8 +74,6 @@ async fn handle_new_user( ) -> Result<()> { // Create let new_user = Arc::new(Mutex::new(generate_new_user(&state))); - tracing::debug!("User created at ptr: {:p}", new_user); - tracing::debug!("User borrowed ptr: {:p}", *&new_user); // Notify client of new username sender @@ -84,14 +82,6 @@ async fn handle_new_user( // Register using `addr` as key until something longer lived exists state.online_users.lock().unwrap().insert(*addr, new_user); - tracing::debug!( - "New user inserted at ptr: {:p}", - state.online_users.lock().unwrap().get(addr).unwrap() - ); - tracing::debug!( - "New user hashmap deref ptr: {:p}", - *state.online_users.lock().unwrap().get(addr).unwrap() - ); // Hydrate client // this should probably be combined and sent as one diff --git a/server/src/api/message_handler.rs b/server/src/api/message_handler.rs index 1bd6845..aee0565 100644 --- a/server/src/api/message_handler.rs +++ b/server/src/api/message_handler.rs @@ -152,14 +152,6 @@ fn handle_user_log_in( tx.send(to_string::(&ChatMessage { text: msg })?)?; } - tracing::debug!( - "User updated at ptr: {:p}", - state.online_users.lock().unwrap().get(&addr).unwrap() - ); - tracing::debug!( - "User updated deref ptr: {:p}", - *state.online_users.lock().unwrap().get(&addr).unwrap() - ); tracing::debug!( "Online Users: {} Offline Users: {}", state.online_users.lock().unwrap().len(), @@ -228,16 +220,8 @@ fn handle_close( state.online_users.lock().unwrap().remove(&addr).unwrap(), ); - tracing::debug!( - "User moved to offline ptr: {:p}", - state.offline_users.lock().unwrap().get(&name).unwrap() - ); - tracing::debug!( - "User offline deref ptr: {:p}", - *state.offline_users.lock().unwrap().get(&name).unwrap() - ); - tx.send(server_summary_update(&state))?; - tx.send(chat_meta_update(&state))?; + tx.send(server_summary_update(state))?; + tx.send(chat_meta_update(state))?; Ok(()) } diff --git a/server/src/main.rs b/server/src/main.rs index 1be48b4..0ffa8d8 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -98,7 +98,7 @@ async fn main() -> Result<()> { let listener = tokio::net::TcpListener::bind(address) .await .with_context(|| format!("{} is not a valid bind address.", address))?; - tracing::debug!("listening on {}", listener.local_addr()?); + tracing::info!("listening on {}", listener.local_addr()?); axum::serve( listener, app.into_make_service_with_connect_info::(),