From 0791d9aed3be3e14cd24c622283b435aa0b7818f Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 1 Nov 2022 19:22:43 +0100 Subject: [PATCH] warp-server: Proper websocket error reporting --- warp-server/Cargo.toml | 1 + warp-server/src/main.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/warp-server/Cargo.toml b/warp-server/Cargo.toml index 600b635..3f804c5 100644 --- a/warp-server/Cargo.toml +++ b/warp-server/Cargo.toml @@ -9,4 +9,5 @@ edition = "2021" futures-util = { version = "0.3", default-features = false, features = ["sink"] } tokio = { version = "1", features = ["full"] } env_logger = "0.9" +log = "0.4" warp = "0.3" diff --git a/warp-server/src/main.rs b/warp-server/src/main.rs index 1c75e73..c8ecdf2 100644 --- a/warp-server/src/main.rs +++ b/warp-server/src/main.rs @@ -19,7 +19,7 @@ async fn main() { let (tx, rx) = websocket.split(); rx.forward(tx).map(|result| { if let Err(e) = result { - eprintln!("websocket error: {:?}", e); + log::warn!("websocket error: {:?}", e); } }) }) -- 2.39.5