Sha256: 5f52652208d59e13c0989d04523d385c3b79828ac1aab4a6261d7d73d37826da

Contents?: true

Size: 541 Bytes

Versions: 7

Compression:

Stored size: 541 Bytes

Contents

# frozen_string_literal: true

module ActiveJob
  module Traceable
    module LoggingPatch
      extend ActiveSupport::Concern

      included do
        private

        def tag_logger(*tags)
          tags << ActiveJob::Traceable.tracing_info_getter.call.values.compact
          tags.flatten!

          if logger.respond_to?(:tagged)
            tags.unshift 'ActiveJob' unless logger_tagged_by_active_job?
            logger.tagged(*tags) { yield }
          else
            yield
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
activejob-traceable-0.4.2 lib/activejob/traceable/logging_patch.rb
activejob-traceable-0.4.1 lib/activejob/traceable/logging_patch.rb
activejob-traceable-0.4.0 lib/activejob/traceable/logging_patch.rb
activejob-traceable-0.3.6 lib/activejob/traceable/logging_patch.rb
activejob-traceable-0.3.5 lib/activejob/traceable/logging_patch.rb
activejob-traceable-0.3.3 lib/activejob/traceable/logging_patch.rb
activejob-traceable-0.3.2 lib/activejob/traceable/logging_patch.rb