Sha256: 52daa5fd06d507be9255ea7630048c4fc686ad54be913dec0977de85a54bb7af
Contents?: true
Size: 985 Bytes
Versions: 39
Compression:
Stored size: 985 Bytes
Contents
# encoding: utf-8 # Base class for startup logging and testing in multiverse module OneApm module Logger class MemoryLogger def initialize @messages = [] end def is_startup_logger? true end attr_accessor :messages, :level def fatal(*msgs, &blk) messages << [:fatal, msgs, blk] end def error(*msgs, &blk) messages << [:error, msgs, blk] end def warn(*msgs, &blk) messages << [:warn, msgs, blk] end def info(*msgs, &blk) messages << [:info, msgs, blk] end def debug(*msgs, &blk) messages << [:debug, msgs, blk] end def log_exception(level, e, backtrace_level=level) messages << [:log_exception, [level, e, backtrace_level]] end def dump(logger) messages.each do |(method, args, blk)| logger.send(method, *args, &blk) end messages.clear end end end end
Version data entries
39 entries across 39 versions & 1 rubygems