- add logging

This commit is contained in:
Jordan Sissel 2010-10-27 02:50:22 +00:00
parent 64c072be20
commit 7e9bedea32

View file

@ -6,6 +6,9 @@ require "socket" # for Socket.gethostname
class LogStash::Inputs::File class LogStash::Inputs::File
def initialize(url, config={}, &block) def initialize(url, config={}, &block)
@logger = Logger.new(STDERR)
@logger.level = $DEBUG ? Logger::WARN : Logger::DEBUG
@url = url @url = url
@url = URI.parse(url) if url.is_a? String @url = URI.parse(url) if url.is_a? String
@ -28,6 +31,7 @@ class LogStash::Inputs::File
# tag this input # tag this input
public public
def tag(newtag) def tag(newtag)
@logger.debug("Adding tag #{newtag} to #{@url}")
@tags << newtag @tags << newtag
end end