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.24-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.24 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.23-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.23 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.22-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.22 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.21-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.21 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.21.alpha.1-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.21.alpha.1 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.20-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.20 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.19-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.19 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.18-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.18 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.17-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.17 spec/lib/appsignal/logger_spec.rb
appsignal-3.0.16-java spec/lib/appsignal/logger_spec.rb
appsignal-3.0.16 spec/lib/appsignal/logger_spec.rb