Class: Inferno::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/inferno/logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(notifications) ⇒ Logger

Returns a new instance of Logger.



6
7
8
9
10
11
12
# File 'lib/inferno/logger.rb', line 6

def initialize(notifications)
  @logger  = ::Logger.new(STDOUT)
  @logger.formatter = proc do |severity, datetime, progname, msg|
    msg + "\n"
  end
  notifications.on("triggered.event", self) { |payload| @logger.info "Triggered: #{payload[:event].inspect} with payload: #{payload[:payload].inspect}" }
end