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