Class | QueuedLogger |
In: |
lib/queued_logger.rb
|
Parent: | Logger |
# File lib/queued_logger.rb, line 4 def initialize(*args) super(*args) @queue = [] @emitted = false end
# File lib/queued_logger.rb, line 27 def dequeue(level=nil, message=nil) if queued? @queue.clear elsif level and message send("%s_without_queue"%level, message) if @emitted end @emitted = false end
# File lib/queued_logger.rb, line 22 def enqueue(level, message) @queue << [level, message] @emitted = false end