Methods

Included Modules

  • ActiveSupport::Logger::Severity

Attributes

[R] flush_count
[RW] level

Class Public methods

new(level = DEBUG)

📝 Source code
# File activesupport/lib/active_support/log_subscriber/test_helper.rb, line 60
def initialize(level = DEBUG)
  @flush_count = 0
  @level = level
  @logged = Hash.new { |h, k| h[k] = [] }
end
🔎 See on GitHub

Instance Public methods

flush()

📝 Source code
# File activesupport/lib/active_support/log_subscriber/test_helper.rb, line 78
def flush
  @flush_count += 1
end
🔎 See on GitHub

logged(level)

📝 Source code
# File activesupport/lib/active_support/log_subscriber/test_helper.rb, line 74
def logged(level)
  @logged[level].compact.map { |l| l.to_s.strip }
end
🔎 See on GitHub

method_missing(level, message = nil)

📝 Source code
# File activesupport/lib/active_support/log_subscriber/test_helper.rb, line 66
def method_missing(level, message = nil)
  if block_given?
    @logged[level] << yield
  else
    @logged[level] << message
  end
end
🔎 See on GitHub

Definition files