Class: Logging::IO::Buffer
Overview
Write to a buffer.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Raw
#write, #write_multiple_messages, #write_single_message
Methods inherited from Base
Constructor Details
This class inherits a constructor from Logging::IO::Base
Instance Method Details
#buffer ⇒ Object
65 66 67 |
# File 'lib/logging/io.rb', line 65 def buffer @buffer ||= Array.new end |
#log(level, *messages) ⇒ Object
69 70 71 |
# File 'lib/logging/io.rb', line 69 def log(level, *) self.buffer << [level, ] end |
#replay(io) ⇒ Object
73 74 75 76 77 |
# File 'lib/logging/io.rb', line 73 def replay(io) self.buffer.each do |level, *| self.io.log(level, *) end end |