Class: SousVide::Outputs::Logger
- Inherits:
-
Object
- Object
- SousVide::Outputs::Logger
- Defined in:
- lib/sous_vide/outputs/logger.rb
Overview
Prints the report to logger.
Instance Method Summary collapse
-
#call(run_data:, node_data:, resources_data:) ⇒ Object
Prints the report to logger.
-
#initialize(logger: nil) ⇒ Logger
constructor
A new instance of Logger.
Constructor Details
#initialize(logger: nil) ⇒ Logger
Returns a new instance of Logger.
8 9 10 |
# File 'lib/sous_vide/outputs/logger.rb', line 8 def initialize(logger: nil) @logger = logger end |
Instance Method Details
#call(run_data:, node_data:, resources_data:) ⇒ Object
Prints the report to logger.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/sous_vide/outputs/logger.rb', line 13 def call(run_data:, node_data:, resources_data:) log "=============== #{self.class.name} ===============" log "" log "Processing #{resources_data.size} resources." log "" resources_data.each do |tracked| log("#{tracked.execution_order}.", tracked.to_s, tracked.status, "(#{tracked.duration_ms.to_i} ms)", tracked.execution_phase) end log "" log "Node info:" log "" log "Name:", node_data[:chef_node_instance_id] log "IP Address:", node_data[:chef_node_ipv4] log "Role:", node_data[:chef_node_role] log "" log "Run info:" log "" log "ID:", run_data[:chef_run_id] log "Started at:", run_data[:chef_run_started_at] log "Completed at:", run_data[:chef_run_completed_at] log "Success:", run_data[:chef_run_success] log "" end |