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-3.0.15-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.15 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.14-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.14 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.13-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.13 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.12-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.12 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.11-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.11 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.10-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.10 spec/lib/appsignal/logger_spec.rb
appsignal-2.11.10-java spec/lib/appsignal/logger_spec.rb
appsignal-2.11.10 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.9-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.9 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.8-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.8 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.7-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.7 spec/lib/appsignal/logger_spec.rb