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.



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

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



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

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