Class: RubyDep::NullLogger

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

Overview

Shamelessly stolen from github.com/karafka/null-logger

Constant Summary collapse

LOG_LEVELS =
%w(unknown fatal error warn info debug).freeze

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



26
27
28
# File 'lib/ruby_dep/logger.rb', line 26

def method_missing(method_name, *args, &block)
  LOG_LEVELS.include?(method_name.to_s) ? nil : super
end

Instance Method Details

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/ruby_dep/logger.rb', line 22

def respond_to_missing?(method_name, include_private = false)
  LOG_LEVELS.include?(method_name.to_s) || super
end