From 9a31aa03622ccacaf36d523e746ef7e1a39bf07e Mon Sep 17 00:00:00 2001 From: Roderick van Domburg Date: Sat, 11 Dec 2021 20:45:08 +0100 Subject: [PATCH] Pretty-print trace messages --- connect/src/spirc.rs | 2 +- core/src/session.rs | 4 ++-- core/src/token.rs | 2 +- metadata/src/lib.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs index 7b9b0857..e0b817ec 100644 --- a/connect/src/spirc.rs +++ b/connect/src/spirc.rs @@ -620,7 +620,7 @@ impl SpircTask { } fn handle_user_attributes_update(&mut self, update: UserAttributesUpdate) { - trace!("Received attributes update: {:?}", update); + trace!("Received attributes update: {:#?}", update); let attributes: UserAttributes = update .get_pairs() .iter() diff --git a/core/src/session.rs b/core/src/session.rs index 926c4bc1..ed9609d7 100644 --- a/core/src/session.rs +++ b/core/src/session.rs @@ -279,7 +279,7 @@ impl Session { } } - trace!("Received product info: {:?}", user_attributes); + trace!("Received product info: {:#?}", user_attributes); Self::check_catalogue(&user_attributes); self.0.data.write().unwrap().user_data.attributes = user_attributes; @@ -291,7 +291,7 @@ impl Session { | Some(LicenseVersion) => {} _ => { if let Some(packet_type) = PacketType::from_u8(cmd) { - trace!("Ignoring {:?} packet with data {:?}", packet_type, data); + trace!("Ignoring {:?} packet with data {:#?}", packet_type, data); } else { trace!("Ignoring unknown packet {:x}", cmd); } diff --git a/core/src/token.rs b/core/src/token.rs index 91a395fd..b9afa620 100644 --- a/core/src/token.rs +++ b/core/src/token.rs @@ -87,7 +87,7 @@ impl TokenProvider { .expect("No tokens received") .to_vec(); let token = Token::new(String::from_utf8(data).unwrap()).map_err(|_| MercuryError)?; - trace!("Got token: {:?}", token); + trace!("Got token: {:#?}", token); self.lock(|inner| inner.tokens.push(token.clone())); Ok(token) } diff --git a/metadata/src/lib.rs b/metadata/src/lib.rs index 3f1849b5..15b68e1f 100644 --- a/metadata/src/lib.rs +++ b/metadata/src/lib.rs @@ -50,7 +50,7 @@ pub trait Metadata: Send + Sized + 'static { async fn get(session: &Session, id: SpotifyId) -> Result { let response = Self::request(session, id).await?; let msg = Self::Message::parse_from_bytes(&response)?; - trace!("Received metadata: {:?}", msg); + trace!("Received metadata: {:#?}", msg); Self::parse(&msg, id) }