Class: Bugsnag::Middleware::Breadcrumbs

Inherits:
Object
  • Object
show all
Defined in:
lib/bugsnag/middleware/breadcrumbs.rb

Overview

Adds breadcrumbs to the report

Instance Method Summary collapse

Constructor Details

#initialize(next_callable) ⇒ Breadcrumbs

Returns a new instance of Breadcrumbs.

Parameters:

  • next_callable (#call)

    the next callable middleware



7
8
9
# File 'lib/bugsnag/middleware/breadcrumbs.rb', line 7

def initialize(next_callable)
  @next = next_callable
end

Instance Method Details

#call(report) ⇒ Object

Execute this middleware

Parameters:



15
16
17
18
19
# File 'lib/bugsnag/middleware/breadcrumbs.rb', line 15

def call(report)
  breadcrumbs = report.configuration.breadcrumbs.to_a
  report.breadcrumbs = breadcrumbs unless breadcrumbs.empty?
  @next.call(report)
end