use std::net::SocketAddr; use axum::{ extract::ConnectInfo, response::Response, middleware::Next, http::Request, body::Body }; pub async fn logging_middleware( ConnectInfo(addr): ConnectInfo, req: Request, next: Next ) -> Response { println!("[{}] {} {}", addr, req.method(), req.uri()); next.run(req).await }