use std::net::IpAddr; use axum::http::{Method, Uri}; pub async fn log(ip: &IpAddr, method: &Method, uri: &Uri, path: Option<&str>, body: Option<&str>) { if path.is_some() && body.is_some() { println!("{} {} {}{} {}", ip, method, path.unwrap(), uri, body.unwrap()); } else { println!("{} {} {}", ip, method, uri); } }