lib/logstop/formatter.rb in logstop-0.2.8 vs lib/logstop/formatter.rb in logstop-0.3.0
- old
+ new
@@ -1,17 +1,18 @@
require "logger"
module Logstop
class Formatter < ::Logger::Formatter
- def initialize(formatter = nil, url_password: true, email: true, credit_card: true, phone: true, ssn: true, ip: false, scrubber: nil)
+ def initialize(formatter = nil, url_password: true, email: true, credit_card: true, phone: true, ssn: true, ip: false, mac: false, scrubber: nil)
@formatter = formatter || ::Logger::Formatter.new
@url_password = url_password
@email = email
@credit_card = credit_card
@phone = phone
@ssn = ssn
@ip = ip
+ @mac = mac
@scrubber = scrubber
end
def call(severity, timestamp, progname, msg)
Logstop.scrub(
@@ -20,9 +21,10 @@
email: @email,
credit_card: @credit_card,
phone: @phone,
ssn: @ssn,
ip: @ip,
+ mac: @mac,
scrubber: @scrubber
)
end
# for tagged logging