Class: Wukong::Processor::Logger

Inherits:
Wukong::Processor show all
Defined in:
lib/wukong/widget/logger.rb

Overview

A widget that will log all incoming records.

Examples:

Logging records from the command line


$ cat input
1
2
3
$ cat input | wu-local logger
2012-11-28 18:20:46 [INFO] Logger: 1
2012-11-28 18:20:46 [INFO] Logger: 2
2012-11-28 18:20:46 [INFO] Logger: 3

Logging records within a dataflow


Wukong.dataflow(:uses_logger) do
  ... | logger
end

Constant Summary

Constants inherited from Wukong::Processor

SerializerError

Instance Attribute Summary

Attributes included from Hanuman::StageInstanceMethods

#graph

Instance Method Summary collapse

Methods inherited from Wukong::Processor

configure, description, #finalize, #perform_action, #receive_action, #setup, #stop

Methods included from Logging

included

Methods inherited from Hanuman::Stage

#clone

Methods included from Hanuman::StageClassMethods

#builder, #label, #register, #set_builder

Methods included from Hanuman::StageInstanceMethods

#add_link, #linkable_name, #root

Instance Method Details

#process(record) ⇒ Object

Process a given record by logging it.

Parameters:

  • record (Object)


50
51
52
# File 'lib/wukong/widget/logger.rb', line 50

def process(record)
  log.send(level, record)
end