Class: Logsly::BaseOutput

Inherits:
Object
  • Object
show all
Defined in:
lib/logsly/base_output.rb

Direct Known Subclasses

FileOutput, StdoutOutput, SyslogOutput

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&build) ⇒ BaseOutput

Returns a new instance of BaseOutput.



16
17
18
# File 'lib/logsly/base_output.rb', line 16

def initialize(&build)
  @build = build || Proc.new {}
end

Instance Attribute Details

#buildObject (readonly)

Returns the value of attribute build.



14
15
16
# File 'lib/logsly/base_output.rb', line 14

def build
  @build
end

Instance Method Details

#to_appender(*args) ⇒ Object

Raises:

  • (NotImplementedError)


20
21
22
23
24
# File 'lib/logsly/base_output.rb', line 20

def to_appender(*args)
  self.instance_exec(*args, &@build)
  self.colors_obj.run_build(*args)
  self
end

#to_layout(data) ⇒ Object



26
27
28
# File 'lib/logsly/base_output.rb', line 26

def to_layout(data)
  Logging.layouts.pattern(data.to_pattern_opts)
end