Class: Exceptions::Backends::Logger
- Inherits:
-
Exceptions::Backend
- Object
- Exceptions::Backend
- Exceptions::Backends::Logger
- 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
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(logger = ::Logger.new(STDOUT)) ⇒ Logger
constructor
A new instance of Logger.
- #notify(exception, options = {}) ⇒ Object
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
#logger ⇒ Object
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, = {}) logger.info exception end |