summaryrefslogtreecommitdiff
path: root/src/console.rs
diff options
context:
space:
mode:
authorTyler Murphy <tylermurphy534@gmail.com>2023-01-27 16:04:04 -0500
committerTyler Murphy <tylermurphy534@gmail.com>2023-01-27 16:04:04 -0500
commit8536e41c64811630ce8c99eb49d81f89bfb69456 (patch)
tree4066f9e7dc47fbda4b6aa74871d26ebbe3a43d26 /src/console.rs
parentinput length and range checking (diff)
downloadxssbook-8536e41c64811630ce8c99eb49d81f89bfb69456.tar.gz
xssbook-8536e41c64811630ce8c99eb49d81f89bfb69456.tar.bz2
xssbook-8536e41c64811630ce8c99eb49d81f89bfb69456.zip
rusty boio finished
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