Class: Wukong::Processor::Logger

Inherits:
Wukong::Processor show all
Defined in:
lib/wukong/widget/processors.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 Method Summary collapse

Methods inherited from Wukong::Processor

configure, consumes, description, #expected_record_type, #expected_serialization, #finalize, #perform_action, produces, #receive_action, #setup, #stop, valid_serializer?, validate_and_set_serialization

Methods included from Logging

included

Methods included from Hanuman::StageClassMethods

#builder, #label, #register, #set_builder

Instance Method Details

#process(record) ⇒ Object

Process a given record by logging it.

Parameters:

  • record (Object)


52
53
54
# File 'lib/wukong/widget/processors.rb', line 52

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