2019-04-30 08:27:42 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-10-10 09:34:50 +08:00
|
|
|
class FakeLogger
|
2019-02-14 14:58:16 +08:00
|
|
|
attr_reader :warnings, :errors, :infos, :fatals
|
2021-03-15 12:36:10 +08:00
|
|
|
attr_accessor :level
|
2018-10-10 09:34:50 +08:00
|
|
|
|
|
|
|
def initialize
|
|
|
|
@warnings = []
|
|
|
|
@errors = []
|
2021-02-12 21:53:36 +08:00
|
|
|
@debug = []
|
2018-10-23 01:22:23 +08:00
|
|
|
@infos = []
|
2019-02-14 14:58:16 +08:00
|
|
|
@fatals = []
|
2018-10-23 01:22:23 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def info(message = nil)
|
|
|
|
@infos << message
|
2018-10-10 09:34:50 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def warn(message)
|
|
|
|
@warnings << message
|
|
|
|
end
|
|
|
|
|
|
|
|
def error(message)
|
|
|
|
@errors << message
|
|
|
|
end
|
2019-02-14 14:58:16 +08:00
|
|
|
|
|
|
|
def fatal(message)
|
|
|
|
@fatals << message
|
|
|
|
end
|
|
|
|
|
2021-02-12 21:53:36 +08:00
|
|
|
def debug(message)
|
|
|
|
@debug << message
|
|
|
|
end
|
|
|
|
|
2019-02-14 14:58:16 +08:00
|
|
|
def formatter
|
|
|
|
end
|
2018-10-10 09:34:50 +08:00
|
|
|
end
|