Module: Log::Level::Method

Defined in:
lib/log/level.rb

Class Method Summary collapse

Class Method Details

.define(logger, level_name) ⇒ Object



106
107
108
109
110
111
# File 'lib/log/level.rb', line 106

def self.define(logger, level_name)
  level = level_name
  logger.define_singleton_method(level) do |message=nil, tag: nil, tags: nil, &blk|
    self.(message, level, tag: tag, tags: tags, &blk)
  end
end

.remove(logger, level_name) ⇒ Object



113
114
115
# File 'lib/log/level.rb', line 113

def self.remove(logger, level_name)
  logger.instance_eval "undef #{level_name}"
end