Sha256: 633509e0fd6f2c5b2dce5edabae1277562532e12ff26759a55155265e6ff6086

Contents?: true

Size: 571 Bytes

Versions: 10

Compression:

Stored size: 571 Bytes

Contents

module Timber
  module Contexts
    # Adds unnamed tags to the context.
    #
    # **Warning:** It is highly recommend that you use custom contexts instead. As they are
    # more descriptive. This module exists primarily to support the ActiveSupport::TaggedLogging
    # antipattern.
    class Tags < Context
      @keyspace = :tags

      attr_reader :values

      def initialize(attributes)
        @values = attributes[:values] || raise(ArgumentError.new(":values is required"))
      end

      def as_json(_options = {})
        values
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
timber-1.0.13 lib/timber/contexts/tags.rb
timber-1.0.12 lib/timber/contexts/tags.rb
timber-1.0.11 lib/timber/contexts/tags.rb
timber-1.0.10 lib/timber/contexts/tags.rb
timber-1.0.9 lib/timber/contexts/tags.rb
timber-1.0.8 lib/timber/contexts/tags.rb
timber-1.0.7 lib/timber/contexts/tags.rb
timber-1.0.6 lib/timber/contexts/tags.rb
timber-1.0.5 lib/timber/contexts/tags.rb
timber-1.0.4 lib/timber/contexts/tags.rb