Class: Bosh::Deployer::LoggerRenderer
- Inherits:
-
Object
- Object
- Bosh::Deployer::LoggerRenderer
- Defined in:
- lib/bosh/deployer/logger_renderer.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
Returns the value of attribute index.
-
#stage ⇒ Object
Returns the value of attribute stage.
-
#total ⇒ Object
Returns the value of attribute total.
Instance Method Summary collapse
- #enter_stage(stage, total) ⇒ Object
-
#initialize(logger) ⇒ LoggerRenderer
constructor
A new instance of LoggerRenderer.
- #update(state, task) ⇒ Object
Constructor Details
#initialize(logger) ⇒ LoggerRenderer
Returns a new instance of LoggerRenderer.
5 6 7 8 |
# File 'lib/bosh/deployer/logger_renderer.rb', line 5 def initialize(logger) @logger = logger enter_stage('Deployer', 0) end |
Instance Attribute Details
#index ⇒ Object
Returns the value of attribute index.
3 4 5 |
# File 'lib/bosh/deployer/logger_renderer.rb', line 3 def index @index end |
#stage ⇒ Object
Returns the value of attribute stage.
3 4 5 |
# File 'lib/bosh/deployer/logger_renderer.rb', line 3 def stage @stage end |
#total ⇒ Object
Returns the value of attribute total.
3 4 5 |
# File 'lib/bosh/deployer/logger_renderer.rb', line 3 def total @total end |
Instance Method Details
#enter_stage(stage, total) ⇒ Object
10 11 12 13 14 |
# File 'lib/bosh/deployer/logger_renderer.rb', line 10 def enter_stage(stage, total) @stage = stage @total = total @index = 0 end |
#update(state, task) ⇒ Object
16 17 18 19 |
# File 'lib/bosh/deployer/logger_renderer.rb', line 16 def update(state, task) logger.info("#{@stage} - #{state} #{task}") @index += 1 if state == :finished end |