Class: Log4r::Logger

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

Instance Method Summary collapse

Constructor Details

#initialize(_fullname, _level = nil, _additive = true, _trace = false) ⇒ Logger

Returns a new instance of Logger.



4
5
6
# File 'lib/log4r_adapter.rb', line 4

def initialize(_fullname, _level=nil, _additive=true, _trace=false)
  @logger = ::Slf4r::LoggerFacade.new(_fullname)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



8
9
10
# File 'lib/log4r_adapter.rb', line 8

def method_missing(method, *args, &block)
  @logger.send(method, *args, &block) if @logger.respond_to?(method)
end

Instance Method Details

#respend_to?(method) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/log4r_adapter.rb', line 12

def respend_to?(method)
  @logger.respond_to?(method)
end