Class: Exceptions::Backends::LogResult
- Inherits:
-
Exceptions::Backend
- Object
- Exceptions::Backend
- Exceptions::Backends::LogResult
- Defined in:
- lib/exceptions/backends/log_result.rb
Overview
Public: LogResult is an implementation of the Backend interface the wraps an existing backend and logs the result id and url.
Instance Attribute Summary collapse
-
#backend ⇒ Object
readonly
Returns the value of attribute backend.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
- #clear_context(*args) ⇒ Object
- #context(*args) ⇒ Object
-
#initialize(backend, logger = ::Logger.new(STDOUT)) ⇒ LogResult
constructor
A new instance of LogResult.
- #notify(exception, options = {}) ⇒ Object
Constructor Details
#initialize(backend, logger = ::Logger.new(STDOUT)) ⇒ LogResult
Returns a new instance of LogResult.
10 11 12 13 |
# File 'lib/exceptions/backends/log_result.rb', line 10 def initialize(backend, logger = ::Logger.new(STDOUT)) @backend = backend @logger = logger end |
Instance Attribute Details
#backend ⇒ Object (readonly)
Returns the value of attribute backend.
8 9 10 |
# File 'lib/exceptions/backends/log_result.rb', line 8 def backend @backend end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
8 9 10 |
# File 'lib/exceptions/backends/log_result.rb', line 8 def logger @logger end |
Instance Method Details
#clear_context(*args) ⇒ Object
25 26 27 |
# File 'lib/exceptions/backends/log_result.rb', line 25 def clear_context(*args) backend.clear_context(*args) end |
#context(*args) ⇒ Object
21 22 23 |
# File 'lib/exceptions/backends/log_result.rb', line 21 def context(*args) backend.context(*args) end |
#notify(exception, options = {}) ⇒ Object
15 16 17 18 19 |
# File 'lib/exceptions/backends/log_result.rb', line 15 def notify(exception, = {}) backend.notify(exception, ).tap do |result| log exception, result end end |