Class: InstanceAgent::CodeDeployPlugin::ScriptLog
- Inherits:
-
Object
- Object
- InstanceAgent::CodeDeployPlugin::ScriptLog
- Defined in:
- lib/instance_agent/codedeploy_plugin/hook_executor.rb
Instance Attribute Summary collapse
-
#log ⇒ Object
readonly
Returns the value of attribute log.
Instance Method Summary collapse
Instance Attribute Details
#log ⇒ Object (readonly)
Returns the value of attribute log.
9 10 11 |
# File 'lib/instance_agent/codedeploy_plugin/hook_executor.rb', line 9 def log @log end |
Instance Method Details
#append_to_log(log_entry) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/instance_agent/codedeploy_plugin/hook_executor.rb', line 11 def append_to_log(log_entry) log_entry ||= "" @log ||= [] @log.push(log_entry) index = @log.size remaining_buffer = 2048 while (index > 0 && (remaining_buffer - @log[index-1].length) > 0) index = index - 1 remaining_buffer = remaining_buffer - @log[index-1].length end if index > 0 @log = @log.drop(index) end end |
#concat_log(log_entries) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/instance_agent/codedeploy_plugin/hook_executor.rb', line 29 def concat_log(log_entries) log_entries ||= [] log_entries.each do |log_entry| append_to_log(log_entry) end end |