Class: LogSinks::Filters::LevelFilter
- Inherits:
-
LogSinks::Filter
- Object
- LogSinks::Filter
- LogSinks::Filters::LevelFilter
- Defined in:
- lib/log_sinks/filters/level_filter.rb
Overview
Filter by event level. Pass if event level is greater or equal to filter level.
Instance Method Summary collapse
-
#call(event) ⇒ Boolean
Applies filter to the event.
-
#initialize(limit_level) ⇒ LevelFilter
constructor
Initializes new instance of [LogSinks::Filters::LevelFilter].
Constructor Details
#initialize(limit_level) ⇒ LevelFilter
Initializes new instance of [LogSinks::Filters::LevelFilter]
12 13 14 15 |
# File 'lib/log_sinks/filters/level_filter.rb', line 12 def initialize(limit_level) super() @limit_level = LogSinks::Level[limit_level] end |
Instance Method Details
#call(event) ⇒ Boolean
Applies filter to the event
20 21 22 |
# File 'lib/log_sinks/filters/level_filter.rb', line 20 def call(event) event.level >= @limit_level end |