From a66f95b39ff9a461d8f9be9432f74f9d6b7fbaa1 Mon Sep 17 00:00:00 2001 From: sigoden Date: Thu, 21 Dec 2023 08:08:15 +0000 Subject: [PATCH] chore: log error during connection --- src/main.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3d0a337..c1948b5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -94,10 +94,7 @@ fn serve(args: Args, running: Arc) -> Result>> { loop { let (cnx, addr) = listener.accept().await.unwrap(); let Ok(stream) = tls_accepter.accept(cnx).await else { - eprintln!( - "WARNING during tls handshake connection from {}", - addr - ); + warn!("During cls handshake connection from {}", addr); continue; }; let stream = TokioIo::new(stream); @@ -172,7 +169,7 @@ where }; match err.downcast_ref::() { Some(err) if err.kind() == std::io::ErrorKind::UnexpectedEof => {} - _ => eprintln!("WARNING serving connection{}: {}", scope, err), + _ => warn!("Serving connection{}: {}", scope, err), } } }