class Sawmill::EntryProcessor::Not

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

For example, this builds a processor that sends formatted log entries to STDOUT only if their level is NOT at least INFO:

processor = Sawmill::EntryProcessor.build do
  If(Not(FilterByBasicFields(:level => :INFO)), 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/entry_processor/conditionals.rb, line 136
def initialize(child_)
  @child = _interpret_processor(child_)
end

Public Instance Methods

attribute(entry_) click to toggle source
# File lib/sawmill/entry_processor/conditionals.rb, line 152
def attribute(entry_)
  !@child.attribute(entry_)
end
begin_record(entry_) click to toggle source
# File lib/sawmill/entry_processor/conditionals.rb, line 140
def begin_record(entry_)
  !@child.begin_record(entry_)
end
end_record(entry_) click to toggle source
# File lib/sawmill/entry_processor/conditionals.rb, line 144
def end_record(entry_)
  !@child.end_record(entry_)
end
finish() click to toggle source
# File lib/sawmill/entry_processor/conditionals.rb, line 160
def finish
  @child.finish
end
message(entry_) click to toggle source
# File lib/sawmill/entry_processor/conditionals.rb, line 148
def message(entry_)
  !@child.message(entry_)
end
unknown_data(entry_) click to toggle source
# File lib/sawmill/entry_processor/conditionals.rb, line 156
def unknown_data(entry_)
  !@child.unknown_data(entry_)
end