mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 09:53:42 +08:00
303d2227cc
* DEV: Add `#level` and `#level=` to `FakeLogger` * DEV: Fix a leaky test
38 lines
516 B
Ruby
38 lines
516 B
Ruby
# frozen_string_literal: true
|
|
|
|
class FakeLogger
|
|
attr_reader :warnings, :errors, :infos, :fatals
|
|
attr_accessor :level
|
|
|
|
def initialize
|
|
@warnings = []
|
|
@errors = []
|
|
@debug = []
|
|
@infos = []
|
|
@fatals = []
|
|
end
|
|
|
|
def info(message = nil)
|
|
@infos << message
|
|
end
|
|
|
|
def warn(message)
|
|
@warnings << message
|
|
end
|
|
|
|
def error(message)
|
|
@errors << message
|
|
end
|
|
|
|
def fatal(message)
|
|
@fatals << message
|
|
end
|
|
|
|
def debug(message)
|
|
@debug << message
|
|
end
|
|
|
|
def formatter
|
|
end
|
|
end
|