Class: Bitcoin::Logger::LogWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/bitcoin/logger.rb

Overview

wrap a logger and prepend a special name in front of the messages

Instance Method Summary collapse

Constructor Details

#initialize(name, log) ⇒ LogWrapper

Returns a new instance of LogWrapper.



61
# File 'lib/bitcoin/logger.rb', line 61

def initialize(name, log); @name, @log = name, log; end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *a, &blk) ⇒ Object



62
63
64
# File 'lib/bitcoin/logger.rb', line 62

def method_missing(m, *a, &blk)
  @log.send(m, *a, &proc{ "#{@name} #{blk.call}" })
end