Commit 415303448bc0758857cade9a83327dc5a62dfa60

Authored by Julian Langschaedel

merge barmstrong/master

Showing 1 changed file Side-by-side Diff

lib/bitcoin/protocol/parser.rb
... ... @@ -2,10 +2,14 @@
2 2 module Protocol
3 3  
4 4 class Parser
  5 +
5 6 def initialize(handler=nil)
6 7 @h = handler || Handler.new
7 8 @buf = ""
  9 + @log = Bitcoin::Logger.create("parser")
8 10 end
  11 +
  12 + def log; @log; end
9 13  
10 14 # handles inv/getdata packets
11 15 #
12 16  
... ... @@ -118,9 +122,9 @@
118 122 def handle_error(type, msg)
119 123 case type
120 124 when :close
121   - puts "closing packet stream (#{msg})"
  125 + log.debug {"closing packet stream (#{msg})"}
122 126 else
123   - p [type, msg]
  127 + log.debug { [type, msg] }
124 128 end
125 129 end
126 130 end # Parser