Merge branch 'stanza-debug-time' into 'master'
Make stanza_debug print the time See merge request !23
This commit is contained in:
commit
264e58b1bf
3 changed files with 5 additions and 2 deletions
|
@ -23,6 +23,7 @@ minidom = "0.4.1"
|
||||||
jid = "0.2.1"
|
jid = "0.2.1"
|
||||||
sasl = "0.4.0"
|
sasl = "0.4.0"
|
||||||
sha-1 = "0.3.3"
|
sha-1 = "0.3.3"
|
||||||
|
chrono = "0.3.1"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
insecure = []
|
insecure = []
|
||||||
|
|
|
@ -6,6 +6,7 @@ extern crate openssl;
|
||||||
extern crate minidom;
|
extern crate minidom;
|
||||||
extern crate base64;
|
extern crate base64;
|
||||||
extern crate sha_1;
|
extern crate sha_1;
|
||||||
|
extern crate chrono;
|
||||||
pub extern crate jid;
|
pub extern crate jid;
|
||||||
pub extern crate sasl;
|
pub extern crate sasl;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
use plugin::PluginProxy;
|
use plugin::PluginProxy;
|
||||||
use event::{SendElement, ReceiveElement, Propagation, Priority};
|
use event::{SendElement, ReceiveElement, Propagation, Priority};
|
||||||
|
use chrono::Local;
|
||||||
|
|
||||||
pub struct StanzaDebugPlugin {
|
pub struct StanzaDebugPlugin {
|
||||||
proxy: PluginProxy,
|
proxy: PluginProxy,
|
||||||
|
@ -13,12 +14,12 @@ impl StanzaDebugPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_send_element(&self, evt: &SendElement) -> Propagation {
|
fn handle_send_element(&self, evt: &SendElement) -> Propagation {
|
||||||
println!("[36;1mSEND[0m: {:?}", evt.0);
|
println!("{} [36;1mSEND[0m: {:?}", Local::now(), evt.0);
|
||||||
Propagation::Continue
|
Propagation::Continue
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_receive_element(&self, evt: &ReceiveElement) -> Propagation {
|
fn handle_receive_element(&self, evt: &ReceiveElement) -> Propagation {
|
||||||
println!("[33;1mRECV[0m: {:?}", evt.0);
|
println!("{} [33;1mRECV[0m: {:?}", Local::now(), evt.0);
|
||||||
Propagation::Continue
|
Propagation::Continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue