Class: Qless::Middleware::Sentry::SentryLogger
- Inherits:
-
Object
- Object
- Qless::Middleware::Sentry::SentryLogger
- Defined in:
- lib/qless/middleware/sentry.rb
Overview
Logs a single exception to Sentry, adding pertinent job info.
Instance Method Summary collapse
-
#initialize(exception, job) ⇒ SentryLogger
constructor
A new instance of SentryLogger.
- #log ⇒ Object
Constructor Details
#initialize(exception, job) ⇒ SentryLogger
Returns a new instance of SentryLogger.
17 18 19 |
# File 'lib/qless/middleware/sentry.rb', line 17 def initialize(exception, job) @exception, @job = exception, job end |
Instance Method Details
#log ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/qless/middleware/sentry.rb', line 21 def log event = ::Raven::Event.capture_exception(@exception) do |evt| evt.extra = { job: } end safely_send event end |