Sha256: ae46cd1c8300fcacc7012baaef8a860e549d129dec51caf288338452ea6ab729

Contents?: true

Size: 693 Bytes

Versions: 32

Compression:

Stored size: 693 Bytes

Contents

require "vagrant/util/credential_scrubber"
require "log4r/formatter/formatter"

module Vagrant
  module Util
    # Wrapper for logging formatting to provide
    # information scrubbing prior to being written
    # to output target
    class LoggingFormatter < Log4r::BasicFormatter

      # @return [Log4r::PatternFormatter]
      attr_reader :formatter

      # Creates a new formatter wrapper instance.
      #
      # @param [Log4r::Formatter]
      def initialize(formatter)
        @formatter = formatter
      end

      # Format event and scrub output
      def format(event)
        msg = formatter.format(event)
        CredentialScrubber.desensitize(msg)
      end
    end
  end
end

Version data entries

32 entries across 28 versions & 4 rubygems

Version Path
vagrant-unbundled-2.2.19.0 lib/vagrant/util/logging_formatter.rb
vagrant-unbundled-2.2.18.0 lib/vagrant/util/logging_formatter.rb
vagrant-unbundled-2.2.16.0 lib/vagrant/util/logging_formatter.rb
vagrant-unbundled-2.2.14.0 lib/vagrant/util/logging_formatter.rb
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/lib/vagrant/util/logging_formatter.rb
vagrant-unbundled-2.2.10.0 lib/vagrant/util/logging_formatter.rb
vagrant-unbundled-2.2.9.0 lib/vagrant/util/logging_formatter.rb
vagrant-unbundled-2.2.8.0 lib/vagrant/util/logging_formatter.rb
vagrant-unbundled-2.2.7.0 lib/vagrant/util/logging_formatter.rb
vagrant-unbundled-2.2.6.2 lib/vagrant/util/logging_formatter.rb
vagrant-unbundled-2.2.6.1 lib/vagrant/util/logging_formatter.rb
vagrant-unbundled-2.2.6.0 lib/vagrant/util/logging_formatter.rb
vagrant-unbundled-2.2.5.0 lib/vagrant/util/logging_formatter.rb
vagrant-unbundled-2.2.4.0 lib/vagrant/util/logging_formatter.rb
vagrant-unbundled-2.2.3.0 lib/vagrant/util/logging_formatter.rb
vagrant-unbundled-2.2.2.0 lib/vagrant/util/logging_formatter.rb
vagrant-unbundled-2.2.0.0 lib/vagrant/util/logging_formatter.rb
vagrant-unbundled-2.1.4.0 lib/vagrant/util/logging_formatter.rb
vagrant-unbundled-2.1.2.0 lib/vagrant/util/logging_formatter.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/lib/vagrant/util/logging_formatter.rb