Sha256: f37782c1e31772af673c8a8e721667fd531cf72e42697b3e133ec9d937fcf64e

Contents?: true

Size: 448 Bytes

Versions: 32

Compression:

Stored size: 448 Bytes

Contents

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?
          warn message
        else
          debug message
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
appsignal-3.3.11-java lib/appsignal/utils/integration_logger.rb
appsignal-3.3.11 lib/appsignal/utils/integration_logger.rb
appsignal-3.4.0-java lib/appsignal/utils/integration_logger.rb
appsignal-3.4.0 lib/appsignal/utils/integration_logger.rb
appsignal-3.3.10-java lib/appsignal/utils/integration_logger.rb
appsignal-3.3.10 lib/appsignal/utils/integration_logger.rb
appsignal-3.3.9-java lib/appsignal/utils/integration_logger.rb
appsignal-3.3.9 lib/appsignal/utils/integration_logger.rb
appsignal-3.3.8-java lib/appsignal/utils/integration_logger.rb
appsignal-3.3.8 lib/appsignal/utils/integration_logger.rb
appsignal-3.3.7-java lib/appsignal/utils/integration_logger.rb
appsignal-3.3.7 lib/appsignal/utils/integration_logger.rb
appsignal-3.3.6-java lib/appsignal/utils/integration_logger.rb
appsignal-3.3.6 lib/appsignal/utils/integration_logger.rb
appsignal-3.3.5-java lib/appsignal/utils/integration_logger.rb
appsignal-3.3.5 lib/appsignal/utils/integration_logger.rb
appsignal-3.3.4-java lib/appsignal/utils/integration_logger.rb
appsignal-3.3.4 lib/appsignal/utils/integration_logger.rb
appsignal-3.3.3-java lib/appsignal/utils/integration_logger.rb
appsignal-3.3.3 lib/appsignal/utils/integration_logger.rb