Sha256: d5ce6e3845c83fac20458a7b1f3e44cfe00d288b409d2b01137c5f9dc56562fd

Contents?: true

Size: 373 Bytes

Versions: 7

Compression:

Stored size: 373 Bytes

Contents

# frozen_string_literal: true

module Mnemosyne
  module Global
    def trace(name, meta: {})
      ::ActiveSupport::Notifications.instrument 'trace.mnemosyne',
        name: name, meta: meta do

        yield
      end
    end

    def attach_error(err)
      return unless (trace = ::Mnemosyne::Instrumenter.current_trace)
      trace.attach_error(err)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mnemosyne-ruby-1.7.1 lib/mnemosyne/global.rb
mnemosyne-ruby-1.7.0 lib/mnemosyne/global.rb
mnemosyne-ruby-1.6.2 lib/mnemosyne/global.rb
mnemosyne-ruby-1.6.1 lib/mnemosyne/global.rb
mnemosyne-ruby-1.5.1 lib/mnemosyne/global.rb
mnemosyne-ruby-1.5.0 lib/mnemosyne/global.rb
mnemosyne-ruby-1.4.0 lib/mnemosyne/global.rb