- cherrypick petef's stdout:///debug support

This commit is contained in:
Jordan Sissel 2011-02-16 11:52:14 -08:00
parent c0551dfaaf
commit 31e2bebde7

View file

@ -3,12 +3,26 @@ require "logstash/namespace"
class LogStash::Outputs::Stdout < LogStash::Outputs::Base
public
def register
# nothing to do
def initialize(*args)
super
@opts = {}
if @url.path != "/"
@opts = @url.path[1..-1].split(",")
end
end # def register
public
def receive(event)
puts event
if debug?
ap event
else
puts event
end
end # def event
public
def debug?
return @opts.member?("debug")
end
end # class LogStash::Outputs::Stdout