Class: Semlogr::Sinks::Enriching
- Inherits:
-
Object
- Object
- Semlogr::Sinks::Enriching
- Defined in:
- lib/semlogr/sinks/enriching.rb
Instance Method Summary collapse
- #emit(log_event) ⇒ Object
-
#initialize(enrichers, sink) ⇒ Enriching
constructor
A new instance of Enriching.
Constructor Details
#initialize(enrichers, sink) ⇒ Enriching
Returns a new instance of Enriching.
8 9 10 11 |
# File 'lib/semlogr/sinks/enriching.rb', line 8 def initialize(enrichers, sink) @enrichers = enrichers @sink = sink end |
Instance Method Details
#emit(log_event) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/semlogr/sinks/enriching.rb', line 13 def emit(log_event) @enrichers.each do |enricher| begin enricher.enrich(log_event) rescue StandardError => e SelfLogger.error("Failed to enrich log event using enricher #{enricher.class}", e) end end @sink.emit(log_event) end |