Class: Vagrant::Util::LoggingFormatter
- Inherits:
-
Log4r::BasicFormatter
- Object
- Log4r::BasicFormatter
- Vagrant::Util::LoggingFormatter
- Defined in:
- lib/vagrant/util/logging_formatter.rb
Overview
Wrapper for logging formatting to provide information scrubbing prior to being written to output target
Instance Attribute Summary collapse
- #formatter ⇒ Log4r::PatternFormatter readonly
Instance Method Summary collapse
-
#format(event) ⇒ Object
Format event and scrub output.
-
#initialize(formatter) ⇒ LoggingFormatter
constructor
Creates a new formatter wrapper instance.
Constructor Details
#initialize(formatter) ⇒ LoggingFormatter
Creates a new formatter wrapper instance.
17 18 19 |
# File 'lib/vagrant/util/logging_formatter.rb', line 17 def initialize(formatter) @formatter = formatter end |
Instance Attribute Details
#formatter ⇒ Log4r::PatternFormatter (readonly)
12 13 14 |
# File 'lib/vagrant/util/logging_formatter.rb', line 12 def formatter @formatter end |
Instance Method Details
#format(event) ⇒ Object
Format event and scrub output
22 23 24 25 |
# File 'lib/vagrant/util/logging_formatter.rb', line 22 def format(event) msg = formatter.format(event) CredentialScrubber.desensitize(msg) end |