]> OzVa Git service - ozva-cloud/commitdiff
chore: log error during connection
authorsigoden <sigoden@gmail.com>
Thu, 21 Dec 2023 08:08:15 +0000 (08:08 +0000)
committersigoden <sigoden@gmail.com>
Thu, 21 Dec 2023 08:08:15 +0000 (08:08 +0000)
src/main.rs

index 3d0a33767df86916cd276c057bdd2d9910933f0c..c1948b5c7c1247dd74664254982551c94eb1d896 100644 (file)
@@ -94,10 +94,7 @@ fn serve(args: Args, running: Arc<AtomicBool>) -> Result<Vec<JoinHandle<()>>> {
                             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::<std::io::Error>() {
             Some(err) if err.kind() == std::io::ErrorKind::UnexpectedEof => {}
-            _ => eprintln!("WARNING serving connection{}: {}", scope, err),
+            _ => warn!("Serving connection{}: {}", scope, err),
         }
     }
 }