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.
19 20 21 |
# File 'lib/vagrant/util/logging_formatter.rb', line 19 def initialize(formatter) @formatter = formatter end |
Instance Attribute Details
#formatter ⇒ Log4r::PatternFormatter (readonly)
14 15 16 |
# File 'lib/vagrant/util/logging_formatter.rb', line 14 def formatter @formatter end |
Instance Method Details
#format(event) ⇒ Object
Format event and scrub output
24 25 26 27 |
# File 'lib/vagrant/util/logging_formatter.rb', line 24 def format(event) msg = formatter.format(event) CredentialScrubber.desensitize(msg) end |