Sha256: f18c2069d671cc684b5a707ac398da47dee817a65eb1c5ef2c92e00016a69c5b

Contents?: true

Size: 685 Bytes

Versions: 140

Compression:

Stored size: 685 Bytes

Contents

describe Appsignal::Logger do
  let(:log) { std_stream }
  let(:logger) do
    Appsignal::Logger.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

140 entries across 140 versions & 1 rubygems

Version Path
appsignal-2.11.8-java spec/lib/appsignal/logger_spec.rb
appsignal-2.11.8 spec/lib/appsignal/logger_spec.rb
appsignal-2.11.7 spec/lib/appsignal/logger_spec.rb
appsignal-2.11.7-java spec/lib/appsignal/logger_spec.rb
appsignal-2.11.6 spec/lib/appsignal/logger_spec.rb
appsignal-2.11.6-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.0.beta.1 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.0.beta.1-java spec/lib/appsignal/logger_spec.rb
appsignal-2.11.5-java spec/lib/appsignal/logger_spec.rb
appsignal-2.11.5 spec/lib/appsignal/logger_spec.rb
appsignal-2.11.4-java spec/lib/appsignal/logger_spec.rb
appsignal-2.11.4 spec/lib/appsignal/logger_spec.rb
appsignal-2.11.3-java spec/lib/appsignal/logger_spec.rb
appsignal-2.11.3 spec/lib/appsignal/logger_spec.rb
appsignal-2.11.2-java spec/lib/appsignal/logger_spec.rb
appsignal-2.11.2 spec/lib/appsignal/logger_spec.rb
appsignal-2.11.1-java spec/lib/appsignal/logger_spec.rb
appsignal-2.11.1 spec/lib/appsignal/logger_spec.rb
appsignal-2.11.1.beta.2 spec/lib/appsignal/logger_spec.rb
appsignal-2.11.1.beta.2-java spec/lib/appsignal/logger_spec.rb