From e9cbeb18632e7ca2a541608757d85754e71f0bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Wed, 21 Jun 2023 12:02:11 +0200 Subject: [PATCH] tokio-xmpp: debug print stream:stream too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- tokio-xmpp/ChangeLog | 10 ++++++---- tokio-xmpp/src/xmpp_codec.rs | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tokio-xmpp/ChangeLog b/tokio-xmpp/ChangeLog index 9f247b2e..483ada52 100644 --- a/tokio-xmpp/ChangeLog +++ b/tokio-xmpp/ChangeLog @@ -1,5 +1,7 @@ -xxxxxxxxxx +Version next: +0000-00-00 xxxxxxxxxx * Breaking changes: - - AsyncClient::new takes a parsed Jid instead of string (#72) - * Changes: - - env_logger is now included in dev_dependencies for examples debugging with RUST_LOG=debug \ No newline at end of file + - AsyncClient::new takes a parsed Jid instead of string (#72) + * Changes: + - env_logger is now included in dev_dependencies for examples debugging with RUST_LOG=debug + - Fix debug prints to include all XML being sent and received diff --git a/tokio-xmpp/src/xmpp_codec.rs b/tokio-xmpp/src/xmpp_codec.rs index ca6154ce..f6d99bff 100644 --- a/tokio-xmpp/src/xmpp_codec.rs +++ b/tokio-xmpp/src/xmpp_codec.rs @@ -177,9 +177,9 @@ impl Encoder for XMPPCodec { } write!(buf, ">\n").map_err(to_io_err)?; + write!(dst, "{}", buf)?; let utf8 = std::str::from_utf8(dst)?; - debug!(">> {}", highlight_xml(utf8)); - write!(dst, "{}", buf)? + debug!(">> {}", highlight_xml(utf8)) } Packet::Stanza(stanza) => { let _ = stanza