mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
- style (whitespace changes, mainly)
This commit is contained in:
parent
8ea429942e
commit
312ca86892
1 changed files with 35 additions and 32 deletions
|
@ -4,42 +4,45 @@ require "logstash/plugin"
|
|||
require "logstash/logging"
|
||||
|
||||
# This is the base class for logstash codecs.
|
||||
module LogStash::Codecs
|
||||
class Base < LogStash::Plugin
|
||||
include LogStash::Config::Mixin
|
||||
config_name "codec"
|
||||
module LogStash::Codecs; class Base < LogStash::Plugin
|
||||
include LogStash::Config::Mixin
|
||||
config_name "codec"
|
||||
|
||||
def initialize(params={})
|
||||
super
|
||||
config_init(params)
|
||||
register if respond_to?(:register)
|
||||
end
|
||||
def initialize(params={})
|
||||
super
|
||||
config_init(params)
|
||||
register if respond_to?(:register)
|
||||
end
|
||||
|
||||
public
|
||||
def decode(data)
|
||||
raise "#{self.class}#decode must be overidden"
|
||||
end # def decode
|
||||
public
|
||||
def decode(data)
|
||||
raise "#{self.class}#decode must be overidden"
|
||||
end # def decode
|
||||
|
||||
alias_method :<<, :decode
|
||||
alias_method :<<, :decode
|
||||
|
||||
public
|
||||
def encode(data)
|
||||
raise "#{self.class}#encode must be overidden"
|
||||
end # def encode
|
||||
public
|
||||
def encode(data)
|
||||
raise "#{self.class}#encode must be overidden"
|
||||
end # def encode
|
||||
|
||||
public
|
||||
def teardown; end;
|
||||
public
|
||||
def teardown; end;
|
||||
|
||||
public
|
||||
def on_event(&block)
|
||||
@on_event = block
|
||||
end
|
||||
public
|
||||
def on_event(&block)
|
||||
@on_event = block
|
||||
end
|
||||
|
||||
public
|
||||
def flush(&block)
|
||||
# does nothing by default.
|
||||
# if your codec needs a flush method (like you are spooling things)
|
||||
# you must implement this.
|
||||
end
|
||||
end # class LogStash::Codecs::Base
|
||||
end
|
||||
public
|
||||
def flush(&block)
|
||||
# does nothing by default.
|
||||
# if your codec needs a flush method (like you are spooling things)
|
||||
# you must implement this.
|
||||
end
|
||||
|
||||
public
|
||||
def clone
|
||||
return self.class.new(@params)
|
||||
end
|
||||
end; end # class LogStash::Codecs::Base
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue