Module: Lamian::SentryScopePatch

Defined in:
lib/lamian/sentry_scope_patch.rb

Overview

Patch for the ‘Sentry::Scope`. Extends the attribute accessor by adding an automatic lamian log dump. You should use this patch if you want to asynchronously send events.

Examples:

Prepending ‘Sentry::Scope` class

Sentry::Scope.prepend(Lamian::SentryScopePatch) #=> Sentry::Scope

Instance Method Summary collapse

Instance Method Details

#extraString

Extra data defined in the scope.

Returns:

  • (String)


12
13
14
15
# File 'lib/lamian/sentry_scope_patch.rb', line 12

def extra
  log = Lamian.dump(format: :txt)&.slice(0, Lamian.config.raven_log_size_limit)
  log ? super.merge!(Lamian::SENTRY_EXTRA_KEY => log) : super
end