Class: OneApm::Logger::MemoryLogger
- Inherits:
-
Object
- Object
- OneApm::Logger::MemoryLogger
- Defined in:
- lib/one_apm/logger/memory_logger.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#level ⇒ Object
Returns the value of attribute level.
-
#messages ⇒ Object
Returns the value of attribute messages.
Instance Method Summary collapse
- #debug(*msgs, &blk) ⇒ Object
- #dump(logger) ⇒ Object
- #error(*msgs, &blk) ⇒ Object
- #fatal(*msgs, &blk) ⇒ Object
- #info(*msgs, &blk) ⇒ Object
-
#initialize ⇒ MemoryLogger
constructor
A new instance of MemoryLogger.
- #is_startup_logger? ⇒ Boolean
- #log_exception(level, e, backtrace_level = level) ⇒ Object
- #warn(*msgs, &blk) ⇒ Object
Constructor Details
#initialize ⇒ MemoryLogger
Returns a new instance of MemoryLogger.
8 9 10 |
# File 'lib/one_apm/logger/memory_logger.rb', line 8 def initialize @messages = [] end |
Instance Attribute Details
#level ⇒ Object
Returns the value of attribute level.
16 17 18 |
# File 'lib/one_apm/logger/memory_logger.rb', line 16 def level @level end |
#messages ⇒ Object
Returns the value of attribute messages.
16 17 18 |
# File 'lib/one_apm/logger/memory_logger.rb', line 16 def @messages end |
Instance Method Details
#debug(*msgs, &blk) ⇒ Object
34 35 36 |
# File 'lib/one_apm/logger/memory_logger.rb', line 34 def debug(*msgs, &blk) << [:debug, msgs, blk] end |
#dump(logger) ⇒ Object
42 43 44 45 46 47 |
# File 'lib/one_apm/logger/memory_logger.rb', line 42 def dump(logger) .each do |(method, args, blk)| logger.send(method, *args, &blk) end .clear end |
#error(*msgs, &blk) ⇒ Object
22 23 24 |
# File 'lib/one_apm/logger/memory_logger.rb', line 22 def error(*msgs, &blk) << [:error, msgs, blk] end |
#fatal(*msgs, &blk) ⇒ Object
18 19 20 |
# File 'lib/one_apm/logger/memory_logger.rb', line 18 def fatal(*msgs, &blk) << [:fatal, msgs, blk] end |
#info(*msgs, &blk) ⇒ Object
30 31 32 |
# File 'lib/one_apm/logger/memory_logger.rb', line 30 def info(*msgs, &blk) << [:info, msgs, blk] end |
#is_startup_logger? ⇒ Boolean
12 13 14 |
# File 'lib/one_apm/logger/memory_logger.rb', line 12 def is_startup_logger? true end |
#log_exception(level, e, backtrace_level = level) ⇒ Object
38 39 40 |
# File 'lib/one_apm/logger/memory_logger.rb', line 38 def log_exception(level, e, backtrace_level=level) << [:log_exception, [level, e, backtrace_level]] end |
#warn(*msgs, &blk) ⇒ Object
26 27 28 |
# File 'lib/one_apm/logger/memory_logger.rb', line 26 def warn(*msgs, &blk) << [:warn, msgs, blk] end |