Class: Semlogger::Filter
Instance Attribute Summary collapse
-
#level ⇒ Object
Returns the value of attribute level.
-
#logdev ⇒ Object
Returns the value of attribute logdev.
Instance Method Summary collapse
- #call(severity, *a) ⇒ Object (also: #add)
-
#initialize(level, logdev) ⇒ Filter
constructor
A new instance of Filter.
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
#level ⇒ Object
Returns the value of attribute level.
2 3 4 |
# File 'lib/semlogger/filter.rb', line 2 def level @level end |
#logdev ⇒ Object
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 |