diff --git a/Cargo.toml b/Cargo.toml index 387c3283bf7064876dac9ce25e9db83f182d57ed..3ff406d589d332893e8aa1ba15c06505a5226edd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,7 @@ minidom = "0.4.1" jid = "0.2.1" sasl = "0.4.0" sha-1 = "0.3.3" +chrono = "0.3.1" [features] insecure = [] diff --git a/src/lib.rs b/src/lib.rs index 9ce13a702b1aad58881ce4ebd1f37cea1efe373f..b144d347dace301300b1fbb254b0eeda58cb3a6d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,6 +6,7 @@ extern crate openssl; extern crate minidom; extern crate base64; extern crate sha_1; +extern crate chrono; pub extern crate jid; pub extern crate sasl; diff --git a/src/plugins/stanza_debug.rs b/src/plugins/stanza_debug.rs index c94679a5a67bd11767021bfda773ffe9c0d64d27..12c8c681f4aa39a49d56bc0b628424e4a514c126 100644 --- a/src/plugins/stanza_debug.rs +++ b/src/plugins/stanza_debug.rs @@ -1,5 +1,6 @@ use plugin::PluginProxy; use event::{SendElement, ReceiveElement, Propagation, Priority}; +use chrono::Local; pub struct StanzaDebugPlugin { proxy: PluginProxy, @@ -13,12 +14,12 @@ impl StanzaDebugPlugin { } fn handle_send_element(&self, evt: &SendElement) -> Propagation { - println!("SEND: {:?}", evt.0); + println!("{} SEND: {:?}", Local::now(), evt.0); Propagation::Continue } fn handle_receive_element(&self, evt: &ReceiveElement) -> Propagation { - println!("RECV: {:?}", evt.0); + println!("{} RECV: {:?}", Local::now(), evt.0); Propagation::Continue } }