From d56cfb9377729057d0d599d7a998b9b27c12049e Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 18 Oct 2020 12:09:48 +0200 Subject: Trim down logs --- src/main.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index ccfb81e..43de71b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -85,10 +85,10 @@ async fn proxy( let unauthorized_hosts = currently_unauthorized_hosts(config); if block_uri(&unauthorized_hosts, uri) { - info!("Blocked: {:?}", uri); + debug!("Blocked: {:?}", uri); Ok(Response::new(Body::empty())) } else { - info!("Authorized: {:?}", uri); + debug!("Authorized: {:?}", uri); if req.method() == Method::CONNECT { if let Some(addr) = host_addr(uri) { @@ -146,7 +146,7 @@ async fn tunnel(upgraded: Upgraded, addr: &str) -> std::io::Result<()> { ); } Err(e) => { - warn!("tunnel error: {}", e); + debug!("tunnel error: {}", e); } }; Ok(()) @@ -211,13 +211,15 @@ fn parse_days(str: &str) -> Vec { let xs = str.split("-").collect::>(); let from = parse_day(xs[0]); let to = parse_day(xs[1]); - (1..8).filter(|d| { - if from < to { - d >= &from && d <= &to - } else { - d >= &from || d <= &to - } - }).collect() + (1..8) + .filter(|d| { + if from < to { + d >= &from && d <= &to + } else { + d >= &from || d <= &to + } + }) + .collect() } fn parse_day(str: &str) -> i32 { -- cgit v1.2.3