Class: Lapsoss::RailsEventSubscriber

Inherits:
Object
  • Object
show all
Defined in:
lib/lapsoss/rails_event_subscriber.rb

Overview

Subscribes to Rails' structured event reporter (Rails.event, Rails 8.1+) and records emitted events as Lapsoss breadcrumbs, giving error reports an automatic activity trail without any monkey-patching.

Instance Method Summary collapse

Instance Method Details

#emit(event) ⇒ Object



8
9
10
11
12
# File 'lib/lapsoss/rails_event_subscriber.rb', line 8

def emit(event)
  return unless Lapsoss.client

  Lapsoss.add_breadcrumb(event[:name], type: :event, **(event))
end