net: switch ping/pong messages to trace

they are annoying even on debug

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2025-11-04 12:24:20 -08:00
parent 155278dd3f
commit 267b854953

View File

@@ -7,11 +7,8 @@ use std::time::{Duration, Instant};
use url::Url; use url::Url;
#[cfg(not(target_arch = "wasm32"))]
use ewebsock::{WsEvent, WsMessage}; use ewebsock::{WsEvent, WsMessage};
use tracing::{debug, trace, error};
#[cfg(not(target_arch = "wasm32"))]
use tracing::{debug, error};
use super::subs_debug::SubsDebug; use super::subs_debug::SubsDebug;
@@ -257,7 +254,7 @@ impl RelayPool {
let should_ping = now - relay.last_ping > self.ping_rate; let should_ping = now - relay.last_ping > self.ping_rate;
if should_ping { if should_ping {
debug!("pinging {}", relay.relay.url); trace!("pinging {}", relay.relay.url);
relay.relay.ping(); relay.relay.ping();
relay.last_ping = Instant::now(); relay.last_ping = Instant::now();
} }
@@ -382,7 +379,7 @@ impl RelayPool {
// We only need to do this natively. // We only need to do this natively.
#[cfg(not(target_arch = "wasm32"))] #[cfg(not(target_arch = "wasm32"))]
if let WsMessage::Ping(ref bs) = ev { if let WsMessage::Ping(ref bs) = ev {
debug!("pong {}", relay.url()); trace!("pong {}", relay.url());
match relay { match relay {
PoolRelay::Websocket(wsr) => { PoolRelay::Websocket(wsr) => {
wsr.relay.sender.send(WsMessage::Pong(bs.to_owned())); wsr.relay.sender.send(WsMessage::Pong(bs.to_owned()));