Module: Jsus::Util::Logger::Buffering

Included in:
Jsus::Util::Logger
Defined in:
lib/jsus/util/logger.rb

Instance Method Summary collapse

Instance Method Details

#add(severity, message = nil, progname = nil, &block) ⇒ Object

buffer=



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/jsus/util/logger.rb', line 16

def add(severity, message = nil, progname = nil, &block)
  unless @logdev.nil? or severity < @level
    if message.nil?
      if block_given?
        message = yield
      else
        message = progname
        progname = @progname
      end
    end
    buffer << [severity, message]
  end
  super
end

#bufferObject

Buffer storing logged messages



8
9
10
# File 'lib/jsus/util/logger.rb', line 8

def buffer
  @buffer ||= []
end

#buffer=(value) ⇒ Object

buffer



12
13
14
# File 'lib/jsus/util/logger.rb', line 12

def buffer=(value)
  @buffer = value
end