Class: Logsly::Outputs::Base

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

Overview

BASE

Direct Known Subclasses

File, Stdout, Syslog

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&build) ⇒ Base

Returns a new instance of Base.



20
21
22
# File 'lib/logsly/outputs.rb', line 20

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

Instance Attribute Details

#buildObject (readonly)

Returns the value of attribute build.



18
19
20
# File 'lib/logsly/outputs.rb', line 18

def build
  @build
end

Instance Method Details

#to_appender(*args) ⇒ Object

Raises:

  • (NotImplementedError)


24
25
26
27
28
# File 'lib/logsly/outputs.rb', line 24

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

#to_layout(data) ⇒ Object



30
31
32
# File 'lib/logsly/outputs.rb', line 30

def to_layout(data)
  Logsly::Logging182.layouts.pattern(data.to_pattern_opts)
end