class Honeybadger::Breadcrumbs::Collector
Public Class Methods
Source
# File lib/honeybadger/breadcrumbs/collector.rb, line 29 def initialize(config, buffer = RingBuffer.new) @config = config @buffer = buffer end
Public Instance Methods
Source
# File lib/honeybadger/breadcrumbs/collector.rb, line 37 def add!(breadcrumb) return unless @config[:'breadcrumbs.enabled'] @buffer.add!(breadcrumb) self end
Add Breadcrumb
to stack
@return [self] Filtered breadcrumbs
Also aliased as: <<
Source
# File lib/honeybadger/breadcrumbs/collector.rb, line 62 def to_h { enabled: @config[:'breadcrumbs.enabled'], trail: trail.map(&:to_h) } end
Source
# File lib/honeybadger/breadcrumbs/collector.rb, line 58 def trail select(&:active?) end
All active breadcrumbs you want to remove a breadcrumb from the trail, then you can selectively ignore breadcrumbs while building a notice.
@return [Array] Active breadcrumbs
Private Instance Methods
Source
# File lib/honeybadger/breadcrumbs/collector.rb, line 76 def initialize_dup(source) @buffer = source.instance_variable_get(:@buffer).dup super end
@api private Since the collector is shared with the worker thread, there is a chance it can be cleared before we have prepared the request. We provide the ability to duplicate a collector which should also duplicate the buffer instance, as that holds the breadcrumbs.
Calls superclass method