Class: MemoryLogger::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/memory_logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLogger

Returns a new instance of Logger.



16
17
18
19
# File 'lib/memory_logger.rb', line 16

def initialize
  @io = StringIO.new
  @logger = ::Logger.new(@io)
end

Instance Attribute Details

#formatterObject

Returns the value of attribute formatter.



8
9
10
# File 'lib/memory_logger.rb', line 8

def formatter
  @formatter
end

#loggerObject

Returns the value of attribute logger.



8
9
10
# File 'lib/memory_logger.rb', line 8

def logger
  @logger
end

Instance Method Details

#logged_outputObject



21
22
23
# File 'lib/memory_logger.rb', line 21

def logged_output
  @io.string
end

#messagesObject



25
26
27
# File 'lib/memory_logger.rb', line 25

def messages
  logged_output.split("\n")
end