Class: NewRelic::Agent::MemoryLogger
- Inherits:
-
Object
- Object
- NewRelic::Agent::MemoryLogger
- Defined in:
- lib/new_relic/agent/agent_logger.rb
Overview
Base class for startup logging and testing in multiverse
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) ⇒ Object
- #dump(logger) ⇒ Object
- #error(*msgs) ⇒ Object
- #fatal(*msgs) ⇒ Object
- #info(*msgs) ⇒ Object
-
#initialize ⇒ MemoryLogger
constructor
A new instance of MemoryLogger.
- #is_startup_logger? ⇒ Boolean
- #warn(*msgs) ⇒ Object
Constructor Details
#initialize ⇒ MemoryLogger
Returns a new instance of MemoryLogger.
129 130 131 |
# File 'lib/new_relic/agent/agent_logger.rb', line 129 def initialize @messages = [] end |
Instance Attribute Details
#level ⇒ Object
Returns the value of attribute level.
137 138 139 |
# File 'lib/new_relic/agent/agent_logger.rb', line 137 def level @level end |
#messages ⇒ Object
Returns the value of attribute messages.
137 138 139 |
# File 'lib/new_relic/agent/agent_logger.rb', line 137 def @messages end |
Instance Method Details
#debug(*msgs) ⇒ Object
155 156 157 |
# File 'lib/new_relic/agent/agent_logger.rb', line 155 def debug(*msgs) << [:debug, msgs] end |
#dump(logger) ⇒ Object
159 160 161 162 163 164 |
# File 'lib/new_relic/agent/agent_logger.rb', line 159 def dump(logger) .each do |msg| logger.send(msg[0], msg[1]) end .clear end |
#error(*msgs) ⇒ Object
143 144 145 |
# File 'lib/new_relic/agent/agent_logger.rb', line 143 def error(*msgs) << [:error, msgs] end |
#fatal(*msgs) ⇒ Object
139 140 141 |
# File 'lib/new_relic/agent/agent_logger.rb', line 139 def fatal(*msgs) << [:fatal, msgs] end |
#info(*msgs) ⇒ Object
151 152 153 |
# File 'lib/new_relic/agent/agent_logger.rb', line 151 def info(*msgs) << [:info, msgs] end |
#is_startup_logger? ⇒ Boolean
133 134 135 |
# File 'lib/new_relic/agent/agent_logger.rb', line 133 def is_startup_logger? true end |
#warn(*msgs) ⇒ Object
147 148 149 |
# File 'lib/new_relic/agent/agent_logger.rb', line 147 def warn(*msgs) << [:warn, msgs] end |