diff --git a/Cargo.toml b/Cargo.toml index e430c89..5fde313 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,4 +23,5 @@ optional = true [features] default = ["tls"] tls = ["native-tls"] +debug = [] diff --git a/src/commands.rs b/src/commands.rs index a260380..b5d3eee 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -181,6 +181,10 @@ impl Command { /// Performs the conversion pub fn from_str(s: &str) -> Self { let new = s.trim(); + + #[cfg(feature = "debug")] + print!("{}", new); + let parts: Vec<&str> = new.split_whitespace().collect(); if parts[0] == "PING" { diff --git a/src/lib.rs b/src/lib.rs index 294fbab..5a8c395 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -188,6 +188,9 @@ impl Client { Cow::Owned(new) as Cow }; + #[cfg(feature = "debug")] + println!("{:?}", formatted); + self.stream.write(formatted.as_bytes())?; Ok(())