From 9fd5ff6427ddead286f189e40137c7a0c0b74bf0 Mon Sep 17 00:00:00 2001 From: Igor Katson Date: Thu, 7 Dec 2023 22:48:14 +0000 Subject: [PATCH] Downlevel some annoying log messages --- Makefile | 3 ++- crates/upnp/src/lib.rs | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index fcbcbaa..e4002d6 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,8 @@ webui-build: webui-deps @PHONY: devserver devserver: - CORS_DEBUG=1 cargo run --release -- server start /tmp/scratch/ + echo -n '' > /tmp/rqbit-log + CORS_DEBUG=1 cargo run --release -- --log-file /tmp/rqbit-log server start /tmp/scratch/ @PHONY: clean clean: diff --git a/crates/upnp/src/lib.rs b/crates/upnp/src/lib.rs index 614e1d5..93a3c5d 100644 --- a/crates/upnp/src/lib.rs +++ b/crates/upnp/src/lib.rs @@ -10,7 +10,7 @@ use std::{ time::Duration, }; use tokio::sync::mpsc::{unbounded_channel, UnboundedSender}; -use tracing::{debug, error, error_span, trace, warn, Instrument, Span}; +use tracing::{debug, error_span, trace, warn, Instrument, Span}; use url::Url; const SERVICE_TYPE_WAN_IP_CONNECTION: &str = "urn:schemas-upnp-org:service:WANIPConnection:1"; @@ -236,7 +236,7 @@ impl UpnpEndpoint { .filter_map(|(span, url)| match url { Ok(url) => Some((span, url)), Err(e) => { - error!("bad control url: {e:#}"); + debug!("bad control url: {e:#}"); None } }) @@ -262,7 +262,7 @@ async fn discover_services(location: Url) -> anyhow::Result { let root_desc: RootDesc = from_str(&response) .context("failed to parse response body as xml") .map_err(|e| { - error!("failed to parse this XML: {response}"); + debug!("failed to parse this XML: {response}"); e })?; Ok(root_desc) @@ -429,7 +429,7 @@ impl UpnpPortForwarder { let r = r.unwrap(); let location = r.location.clone(); endpoints.push(self.parse_endpoint(r).map_err(|e| { - error!("failed to parse endpoint: {e:#}"); + debug!("error parsing endpoint: {e:#}"); e }).instrument(error_span!("parse endpoint", location=location.to_string()))); },