class ActiveSupport::LogSubscriber::TestHelper::MockLogger

def flush

def flush
  @flush_count += 1
end

def initialize(level = DEBUG)

def initialize(level = DEBUG)
  @flush_count = 0
  @level = level
  @logged = Hash.new { |h, k| h[k] = [] }
end

def logged(level)

def logged(level)
  @logged[level].compact.map { |l| l.to_s.strip }
end

def method_missing(level, message = nil)

def method_missing(level, message = nil)
  if block_given?
    @logged[level] << yield
  else
    @logged[level] << message
  end
end