class Rutema::Reporters::Console

A very simple event reporter that outputs to the console

It has three settings: off, normal and verbose.

Example configuration:

cfg.reporter={:class=>Rutema::Reporters::Console, "mode"=>"verbose"}

Public Class Methods

new(configuration,dispatcher) click to toggle source
Calls superclass method Rutema::Reporters::EventReporter::new
# File lib/rutema/core/reporter.rb, line 87
def initialize configuration,dispatcher
  super(configuration,dispatcher)
  @mode=configuration.reporters.fetch(self.class,{})["mode"]
end

Public Instance Methods

update(message) click to toggle source
# File lib/rutema/core/reporter.rb, line 91
def update message
  unless @mode=="off"
    case message
    when RunnerMessage
      if message.status == :error
        puts "FATAL|#{message.to_s}"
      else
        puts message.to_s if @mode=="verbose"
      end
    when ErrorMessage
      puts message.to_s 
    when Message
      puts message.to_s if @mode=="verbose"
    end
  end
end