class Sawmill::RecordProcessor::Not

A boolean processor that returns the boolean negation of a given processor.

For example, this builds a processor that sends formatted log records to STDOUT only if they do NOT have a “user” attribute of “daniel”:

processor = Sawmill::RecordProcessor.build do
  If(Not(FilterByAttributes('user' => 'daniel')), Format(STDOUT))
end

Public Class Methods

new(child_) click to toggle source

Create a “not” boolean. The parameter is a boolean processor to run. This processor returns the boolean negation of its output.

# File lib/sawmill/record_processor/conditionals.rb, line 112
def initialize(child_)
  @child = _interpret_processor(child_)
end

Public Instance Methods

extra_entry(entry_) click to toggle source
# File lib/sawmill/record_processor/conditionals.rb, line 120
def extra_entry(entry_)
  !@child.extra_entry(record_)
end
finish() click to toggle source
# File lib/sawmill/record_processor/conditionals.rb, line 124
def finish
  @child.finish
end
record(record_) click to toggle source
# File lib/sawmill/record_processor/conditionals.rb, line 116
def record(record_)
  !@child.record(record_)
end