Class: NewRelic::Agent::MemoryLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/new_relic/agent/agent_logger.rb

Overview

Base class for startup logging and testing in multiverse

Direct Known Subclasses

StartupLogger

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMemoryLogger

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

#levelObject

Returns the value of attribute level.



137
138
139
# File 'lib/new_relic/agent/agent_logger.rb', line 137

def level
  @level
end

#messagesObject

Returns the value of attribute messages.



137
138
139
# File 'lib/new_relic/agent/agent_logger.rb', line 137

def messages
  @messages
end

Instance Method Details

#debug(*msgs) ⇒ Object



155
156
157
# File 'lib/new_relic/agent/agent_logger.rb', line 155

def debug(*msgs)
  messages << [: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)
  messages.each do |msg|
    logger.send(msg[0], msg[1])
  end
  messages.clear
end

#error(*msgs) ⇒ Object



143
144
145
# File 'lib/new_relic/agent/agent_logger.rb', line 143

def error(*msgs)
  messages << [:error, msgs]
end

#fatal(*msgs) ⇒ Object



139
140
141
# File 'lib/new_relic/agent/agent_logger.rb', line 139

def fatal(*msgs)
  messages << [:fatal, msgs]
end

#info(*msgs) ⇒ Object



151
152
153
# File 'lib/new_relic/agent/agent_logger.rb', line 151

def info(*msgs)
  messages << [:info, msgs]
end

#is_startup_logger?Boolean

Returns:

  • (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)
  messages << [:warn, msgs]
end