From 8536e41c64811630ce8c99eb49d81f89bfb69456 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Fri, 27 Jan 2023 16:04:04 -0500 Subject: rusty boio finished --- src/console.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/console.rs (limited to 'src/console.rs') diff --git a/src/console.rs b/src/console.rs new file mode 100644 index 0000000..5a3c60b --- /dev/null +++ b/src/console.rs @@ -0,0 +1,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); + } + + +} \ No newline at end of file -- cgit v1.2.3-freya