Sha256: c31ec59838459d3207347565d2f5383253666cf1c3c183927e341fd6b1778afe

Contents?: true

Size: 721 Bytes

Versions: 112

Compression:

Stored size: 721 Bytes

Contents

describe Appsignal::Utils::IntegrationLogger do
  let(:log) { std_stream }
  let(:logger) do
    Appsignal::Utils::IntegrationLogger.new(log).tap do |l|
      l.formatter = logger_formatter
    end
  end

  describe "#seen_keys" do
    it "returns a Set" do
      expect(logger.seen_keys).to be_a(Set)
    end
  end

  describe "#warn_once_then_debug" do
    it "only warns once, then uses debug" do
      message = "This is a log line"
      3.times { logger.warn_once_then_debug(:key, message) }

      logs = log_contents(log)
      expect(logs.scan(/#{Regexp.escape(log_line(:WARN, message))}/).count).to eql(1)
      expect(logs.scan(/#{Regexp.escape(log_line(:DEBUG, message))}/).count).to eql(2)
    end
  end
end

Version data entries

112 entries across 112 versions & 1 rubygems

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