Sha256: 7a49a94d01eef7fcb5d4322e6f75867a9e94487a5404a43d7ee324ed7031ad7b
Contents?: true
Size: 770 Bytes
Versions: 9
Compression:
Stored size: 770 Bytes
Contents
require "logstash/namespace" require "logstash/outputs/base" class LogStash::Outputs::Internal < LogStash::Outputs::Base public def initialize(url, config={}, &block) super @callback = block end # def initialize public def register @logger.info("Registering output #{@url}") end # def register public def receive(event) if !@callback @logger.error("No callback for output #{@url}, cannot receive") return end @callback.call(event) end # def event # Set the callback by passing a block of code public def callback(&block) @callback = block end # Set the callback by passing a proc object public def callback=(proc_block) @callback = proc_block end end # class LogStash::Outputs::Internal
Version data entries
9 entries across 9 versions & 1 rubygems