blob: 5a3c60be942f144a72d6e2b43377f8e2491adccb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
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);
}
}
|