Class: Logsly::BaseOutput
- Inherits:
-
Object
- Object
- Logsly::BaseOutput
- Defined in:
- lib/logsly/base_output.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#build ⇒ Object
readonly
Returns the value of attribute build.
Instance Method Summary collapse
-
#initialize(&build) ⇒ BaseOutput
constructor
A new instance of BaseOutput.
- #to_appender(*args) ⇒ Object
- #to_layout(data) ⇒ Object
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
#build ⇒ Object (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
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 |