pass debug option down since we controll warn
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 19 Aug 2014 13:27:49 +0000 (15:27 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 19 Aug 2014 13:27:49 +0000 (15:27 +0200)
lib/Biblio/RFID/Reader.pm
scripts/RFID-JSONP-server.pl

index 0ec702e..be2f5db 100644 (file)
@@ -120,6 +120,17 @@ sub to_hash {
        return $hash;
 }
 
+=head2 debug
+
+  $self->debug(1); # or more
+
+=cut
+
+sub debug {
+       my ( $self, $level ) = @_;
+       $debug = $level;
+       warn "debug level $level\n" if $level;
+}
 
 =head1 PRIVATE
 
index 8d44048..1c93c2d 100755 (executable)
@@ -66,6 +66,7 @@ use lib 'lib';
 use Biblio::RFID::RFID501;
 use Biblio::RFID::Reader;
 my $rfid = Biblio::RFID::Reader->new( shift @ARGV );
+$rfid->debug( $debug );
 
 my $index_html;
 {