summaryrefslogtreecommitdiff
path: root/src/console.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/console.rs')
-rw-r--r--src/console.rs13
1 files changed, 13 insertions, 0 deletions
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