Skip to content

Commit

Permalink
src: lib: web: Add Debug to requests
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoantoniocardoso committed Oct 29, 2024
1 parent 9cad33a commit bdc7e2e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/web/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ fn default_router(state: AppState) -> Router {
async fn websocket_handler(ws: WebSocketUpgrade, State(state): State<AppState>) -> Response {
ws.on_upgrade(|socket| async { websocket_connection(socket, state).await })
}

#[instrument(level = "debug", skip(socket, state))]
async fn websocket_connection(socket: WebSocket, state: AppState) {
let identifier = Uuid::new_v4();
debug!("WS client connected with ID: {identifier}");
Expand Down Expand Up @@ -100,7 +102,7 @@ async fn websocket_connection(socket: WebSocket, state: AppState) {
send_task.await.unwrap();
}

#[derive(Deserialize)]
#[derive(Debug, Deserialize)]
struct FrequencyQuery {
frequency: Option<u8>,
}
Expand Down

0 comments on commit bdc7e2e

Please sign in to comment.