Class: PiiScrubber::Integrations::LoggerFormatter
- Inherits:
-
Logger::Formatter
- Object
- Logger::Formatter
- PiiScrubber::Integrations::LoggerFormatter
- Defined in:
- lib/pii_scrubber/integrations/logger_formatter.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#original_formatter ⇒ Object
readonly
Returns the value of attribute original_formatter.
Instance Method Summary collapse
- #call(severity, time, program_name, message) ⇒ Object
-
#initialize(original_formatter = nil, **options) ⇒ LoggerFormatter
constructor
A new instance of LoggerFormatter.
Constructor Details
#initialize(original_formatter = nil, **options) ⇒ LoggerFormatter
Returns a new instance of LoggerFormatter.
10 11 12 13 14 |
# File 'lib/pii_scrubber/integrations/logger_formatter.rb', line 10 def initialize(original_formatter = nil, **) super() @original_formatter = original_formatter || ::Logger::Formatter.new @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/pii_scrubber/integrations/logger_formatter.rb', line 8 def @options end |
#original_formatter ⇒ Object (readonly)
Returns the value of attribute original_formatter.
8 9 10 |
# File 'lib/pii_scrubber/integrations/logger_formatter.rb', line 8 def original_formatter @original_formatter end |
Instance Method Details
#call(severity, time, program_name, message) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/pii_scrubber/integrations/logger_formatter.rb', line 16 def call(severity, time, program_name, ) scrubbed_msg = () if original_formatter.respond_to?(:call) original_formatter.call(severity, time, program_name, scrubbed_msg) else super(severity, time, program_name, scrubbed_msg) end end |