From: Ruben Beltran del Rio Date: Mon, 27 Jan 2025 21:25:38 +0000 (+0100) Subject: Escape chars when debugging X-Git-Tag: 1.1.0~11 X-Git-Url: https://git.r.bdr.sh/rbdr/olden-mail/commitdiff_plain/661adbfbd282568dca144bf7ec39c3fbbda80d90?ds=inline;hp=ba29d86226e276bedd1f6f1623d32652df7f3205 Escape chars when debugging --- diff --git a/src/middleware/find_mailboxes_compatibility.rs b/src/middleware/find_mailboxes_compatibility.rs index 0e4b2cd..ddc12f1 100644 --- a/src/middleware/find_mailboxes_compatibility.rs +++ b/src/middleware/find_mailboxes_compatibility.rs @@ -24,7 +24,11 @@ impl Middleware for FindMailboxesCompatibility { // We'll need to convert the LIST to a FIND self.tags.push(tag.trim().to_string()); let replacement = format!("{} LIST \"\" \"*\"\r\n", tag.trim()); - debug!("### {replacement}"); + let debug_str = replacement + .replace('\n', "\\n") + .replace('\r', "\\r") + .replace('\t', "\\t"); + debug!("### {debug_str}"); return replacement.into_bytes(); } } @@ -63,6 +67,13 @@ impl Middleware for FindMailboxesCompatibility { }) .collect(); - lines.join("\n").into_bytes() + let replacement = lines.join("\n"); + let debug_str = replacement + .replace('\n', "\\n") + .replace('\r', "\\r") + .replace('\t', "\\t"); + debug!("### {debug_str}"); + + replacement.into_bytes() } }