Class: OMF::Web::Widget::Log::LogOutputter

Inherits:
Log4r::Outputter
  • Object
show all
Defined in:
lib/omf-web/widget/UNUSED/log/log_outputter.rb

Constant Summary collapse

@@instance =
nil

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = 'remote', hash = {}) ⇒ LogOutputter

Returns a new instance of LogOutputter.



15
16
17
18
19
20
21
22
# File 'lib/omf-web/widget/UNUSED/log/log_outputter.rb', line 15

def initialize(name = 'remote', hash={})
  puts ">>>> LOG_OUTPUTTER"
  super(name, hash)
  self.formatter = (hash[:formatter] or hash['formatter'] or WebFormatter.new)

  @event = []
  @@instance = self
end

Class Method Details

.instanceObject



11
12
13
# File 'lib/omf-web/widget/UNUSED/log/log_outputter.rb', line 11

def self.instance
  @@instance
end

Instance Method Details

#format(logevent) ⇒ Object



28
29
30
31
32
33
# File 'lib/omf-web/widget/UNUSED/log/log_outputter.rb', line 28

def format(logevent)
  # @formatter is guaranteed to be DefaultFormatter if no Formatter
  # was specified
  @event << [@formatter.format(logevent), logevent]
  #puts ">>>>>>>>>>>>>>>> #{logevent.inspect}"
end

#remaining_events(index) ⇒ Object



24
25
26
# File 'lib/omf-web/widget/UNUSED/log/log_outputter.rb', line 24

def remaining_events(index)
  @event[index .. -1]
end