lib/logstop/formatter.rb in logstop-0.2.3 vs lib/logstop/formatter.rb in logstop-0.2.4
- old
+ new
@@ -1,15 +1,16 @@
require "logger"
module Logstop
class Formatter < ::Logger::Formatter
- def initialize(formatter = nil, ip: false)
+ def initialize(formatter = nil, ip: false, scrubber: nil)
@formatter = formatter || ::Logger::Formatter.new
@ip = ip
+ @scrubber = scrubber
end
def call(severity, timestamp, progname, msg)
- Logstop.scrub(@formatter.call(severity, timestamp, progname, msg), ip: @ip)
+ Logstop.scrub(@formatter.call(severity, timestamp, progname, msg), ip: @ip, scrubber: @scrubber)
end
# for tagged logging
def method_missing(method_name, *arguments, &block)
@formatter.send(method_name, *arguments, &block)