Class: Semlogger::Filter

Inherits:
Object show all
Defined in:
lib/semlogger/filter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(level, logdev) ⇒ Filter

Returns a new instance of Filter.



4
5
6
7
# File 'lib/semlogger/filter.rb', line 4

def initialize level, logdev
	@level = level
	@logdev = logdev
end

Instance Attribute Details

#levelObject

Returns the value of attribute level.



2
3
4
# File 'lib/semlogger/filter.rb', line 2

def level
  @level
end

#logdevObject

Returns the value of attribute logdev.



2
3
4
# File 'lib/semlogger/filter.rb', line 2

def logdev
  @logdev
end

Instance Method Details

#call(severity, *a) ⇒ Object Also known as: add



9
10
11
12
# File 'lib/semlogger/filter.rb', line 9

def call severity, *a
	return true  if @level > severity
	@logdev.add severity, *a
end