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.
19 20 21 |
# File 'lib/qless/middleware/sentry.rb', line 19 def initialize(exception, job) @exception, @job = exception, job end |
Instance Method Details
#log ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/qless/middleware/sentry.rb', line 23 def log event = ::Raven::Event.capture_exception(@exception) do |evt| evt.extra = { job: } end safely_send event end |