Class: Exceptions::Backends::Logger

Inherits:
Exceptions::Backend show all
Defined in:
lib/exceptions/backends/logger.rb

Overview

Public: Logger is an implementation of the Backend interface that logs exceptions to STDOUT.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Exceptions::Backend

#clear_context, #context, #rack_exception

Constructor Details

#initialize(logger = ::Logger.new(STDOUT)) ⇒ Logger

Returns a new instance of Logger.



8
9
10
# File 'lib/exceptions/backends/logger.rb', line 8

def initialize(logger = ::Logger.new(STDOUT))
  @logger = logger
end

Instance Attribute Details

#loggerObject

Returns the value of attribute logger.



6
7
8
# File 'lib/exceptions/backends/logger.rb', line 6

def logger
  @logger
end

Instance Method Details

#notify(exception, options = {}) ⇒ Object



12
13
14
# File 'lib/exceptions/backends/logger.rb', line 12

def notify(exception, options = {})
  logger.info exception
end