Sha256: 2486bfcb9e8b075ce7d5aa67bc17a1f3f7ce535e72ee644b49d37da91abd18f9

Contents?: true

Size: 641 Bytes

Versions: 1

Compression:

Stored size: 641 Bytes

Contents

# frozen_string_literal: true

module Memolog::SentryExtension
  def self.prepended(base)
    base.singleton_class.send(:prepend, ClassMethods)
  end

  module ClassMethods
    def capture_exception(exception, **options, &block)
      add_memolog_to_current_scope!
      super
    end

    def capture_message(message, **options, &block)
      add_memolog_to_current_scope!
      super
    end

    def add_memolog_to_current_scope!
      dump = Memolog.dump
      return unless dump

      scope = get_current_scope
      scope.set_extras(Memolog.config.sentry_key => dump) if scope # rubocop:disable Style/SafeNavigation
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
memolog-0.3.1 lib/memolog/sentry_extension.rb