From 313e7a17709a0b4e0c448e21bea392b836653ba3 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Tue, 30 May 2017 22:13:47 +0100 Subject: [PATCH] add stanza_debug to client example when STANZA_DEBUG is in the env --- examples/client.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/client.rs b/examples/client.rs index 191021e..db1567c 100644 --- a/examples/client.rs +++ b/examples/client.rs @@ -2,6 +2,7 @@ extern crate xmpp; use xmpp::jid::Jid; use xmpp::client::ClientBuilder; +use xmpp::plugins::stanza_debug::StanzaDebugPlugin; use xmpp::plugins::stanza::StanzaPlugin; use xmpp::plugins::unhandled_iq::UnhandledIqPlugin; use xmpp::plugins::messaging::{MessagingPlugin, MessageEvent}; @@ -20,6 +21,9 @@ fn main() { .password(pass) .connect() .unwrap(); + if env::var("STANZA_DEBUG").is_ok() { + client.register_plugin(StanzaDebugPlugin::new()); + } client.register_plugin(StanzaPlugin::new()); client.register_plugin(UnhandledIqPlugin::new()); client.register_plugin(MessagingPlugin::new());