diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-02-16 23:34:07 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-02-16 23:34:07 -0600 |
commit | 72566686258c5cde32fbc935a2aa9bbc155ba369 (patch) | |
tree | 15bbaa7f7b3255f99a808114ab60cb767b78daca | |
parent | aec02b463607f6e45919aa3e688b205aab9a195e (diff) | |
download | net-flowdock-stream-72566686258c5cde32fbc935a2aa9bbc155ba369.tar.gz net-flowdock-stream-72566686258c5cde32fbc935a2aa9bbc155ba369.zip |
allow debug mode, to print out events as they come in
-rw-r--r-- | lib/Net/Flowdock/Stream.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Net/Flowdock/Stream.pm b/lib/Net/Flowdock/Stream.pm index 23db07d..7b7603d 100644 --- a/lib/Net/Flowdock/Stream.pm +++ b/lib/Net/Flowdock/Stream.pm @@ -35,6 +35,12 @@ has socket_timeout => ( default => 0.01, ); +has debug => ( + is => 'rw', + isa => 'Bool', + default => 0, +); + has _socket => ( is => 'rw', isa => 'Net::HTTPS::NB', @@ -135,6 +141,7 @@ sub _process_readbuf { if ((my $buf = $self->_readbuf) =~ s/^([^\x0d]*)\x0d//) { my $chunk = $1; $self->_readbuf($buf); + warn "New event:\n$chunk" if $self->debug; return decode_json($chunk); } |