Sha256: 278948b2cde6df7aed94c031933f18b636e78cbe8441edd840533ea68acc1057

Contents?: true

Size: 563 Bytes

Versions: 1

Compression:

Stored size: 563 Bytes

Contents

# frozen_string_literal: true

require "active_support/tagged_logging"

begin
  require "active_support/isolated_execution_state"

  # it's not needed when state is already isolated
rescue LoadError
  ActiveSupport::TaggedLogging::Formatter.prepend(Module.new {
    def current_tags
      thread_key = @thread_key ||= "activesupport_tagged_logging_tags:#{__id__}"
      unless Thread.current.thread_variable_get(thread_key)
        Thread.current.thread_variable_set(thread_key, [])
      end
      Thread.current.thread_variable_get(thread_key)
    end
  })
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dry-effects-0.5.0 lib/dry/effects/extensions/active_support/tagged_logging.rb