nimble_http/debug.rs
1use crate::Router;
2use hyper::{Method, StatusCode};
3
4impl Router {
5 pub fn debug(mut self) -> Self {
6 self.enable_logger = true;
7 self
8 }
9
10 pub(crate) fn request_log(
11 &self,
12 ip: String,
13 method: &Method,
14 path: String,
15 status: StatusCode,
16 ) {
17 println!(
18 "{} {} {} -> {} ({})",
19 ip,
20 method,
21 path,
22 status.as_u16(),
23 status.canonical_reason().unwrap_or("Unknown")
24 );
25 }
26}