From 86cdf4810631a381aa16969aba4534121e211d3d Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 19 Nov 2024 00:13:24 +0100 Subject: [PATCH] `database`: Add debug logging --- acrate_database/src/meta.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/acrate_database/src/meta.rs b/acrate_database/src/meta.rs index ee23e19..17e141a 100644 --- a/acrate_database/src/meta.rs +++ b/acrate_database/src/meta.rs @@ -355,10 +355,13 @@ impl FromSql for Mime String: FromSql, { fn from_sql(bytes: ::RawValue<'_>) -> diesel::deserialize::Result { + log::trace!("Reading TEXT from the database..."); let s = >::from_sql(bytes)?; + log::trace!("Attempting to parse as a media type: {s:?}"); let mime = mime::Mime::from_str(&s)?; + log::trace!("Successfully parsed media type: {mime:?}"); Ok(Self(mime)) } } @@ -370,8 +373,10 @@ impl ToSql for Mime str: ToSql, { fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, DB>) -> diesel::serialize::Result { + log::trace!("Getting the essence of a media type to prepare for serialization..."); let mime = self.0.essence_str(); + log::trace!("Serializing media type as TEXT: {mime:?}"); >::to_sql(mime, out) } }