Class: Bosh::Deployer::LoggerRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/deployer/logger_renderer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLoggerRenderer

Returns a new instance of LoggerRenderer.



5
6
7
# File 'lib/bosh/deployer/logger_renderer.rb', line 5

def initialize
  enter_stage('Deployer', 0)
end

Instance Attribute Details

#indexObject

Returns the value of attribute index.



3
4
5
# File 'lib/bosh/deployer/logger_renderer.rb', line 3

def index
  @index
end

#stageObject

Returns the value of attribute stage.



3
4
5
# File 'lib/bosh/deployer/logger_renderer.rb', line 3

def stage
  @stage
end

#totalObject

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



9
10
11
12
13
# File 'lib/bosh/deployer/logger_renderer.rb', line 9

def enter_stage(stage, total)
  @stage = stage
  @total = total
  @index = 0
end

#update(state, task) ⇒ Object



15
16
17
18
# File 'lib/bosh/deployer/logger_renderer.rb', line 15

def update(state, task)
  Config.logger.info("#{@stage} - #{state} #{task}")
  @index += 1 if state == :finished
end