Sha256: 530db5e42435d4b66f470951c6b0847761977b7db740aa99f607ec5f3f46571e

Contents?: true

Size: 478 Bytes

Versions: 80

Compression:

Stored size: 478 Bytes

Contents

# frozen_string_literal: true

module Appsignal
  module Utils
    # Subclass of logger with method to only log a warning once
    # prevents the local log from filling up with repeated messages.
    class IntegrationLogger < ::Logger
      def seen_keys
        @seen_keys ||= Set.new
      end

      def warn_once_then_debug(key, message)
        if seen_keys.add?(key).nil?
          debug message
        else
          warn message
        end
      end
    end
  end
end

Version data entries

80 entries across 80 versions & 1 rubygems

Version Path
appsignal-3.10.0-java lib/appsignal/utils/integration_logger.rb
appsignal-3.10.0 lib/appsignal/utils/integration_logger.rb
appsignal-3.9.3-java lib/appsignal/utils/integration_logger.rb
appsignal-3.9.3 lib/appsignal/utils/integration_logger.rb
appsignal-3.9.2-java lib/appsignal/utils/integration_logger.rb
appsignal-3.9.2 lib/appsignal/utils/integration_logger.rb
appsignal-3.9.1-java lib/appsignal/utils/integration_logger.rb
appsignal-3.9.1 lib/appsignal/utils/integration_logger.rb
appsignal-3.9.0-java lib/appsignal/utils/integration_logger.rb
appsignal-3.9.0 lib/appsignal/utils/integration_logger.rb
appsignal-3.8.1-java lib/appsignal/utils/integration_logger.rb
appsignal-3.8.1 lib/appsignal/utils/integration_logger.rb
appsignal-3.8.0-java lib/appsignal/utils/integration_logger.rb
appsignal-3.8.0 lib/appsignal/utils/integration_logger.rb
appsignal-3.7.6-java lib/appsignal/utils/integration_logger.rb
appsignal-3.7.6 lib/appsignal/utils/integration_logger.rb
appsignal-3.7.2-java lib/appsignal/utils/integration_logger.rb
appsignal-3.7.2 lib/appsignal/utils/integration_logger.rb
appsignal-3.7.1-java lib/appsignal/utils/integration_logger.rb
appsignal-3.7.1 lib/appsignal/utils/integration_logger.rb