class ActionController::LogSubscriber

Public Instance Methods

start_processing_with_flog(event) click to toggle source
# File lib/flog/params_formattable.rb, line 10
def start_processing_with_flog(event)
  return start_processing_without_flog(event) unless Flog::Status.enabled?

  replaced = replace_params(event.payload[:params])

  shunt_payload_value(event.payload, :params, replaced) do
    start_processing_without_flog(event)
  end
end

Private Instance Methods

replace_params(params) click to toggle source
# File lib/flog/params_formattable.rb, line 22
def replace_params(params)
  return params if params.empty? || !params.respond_to?(:ai)

  replaced = params.dup
  class << replaced
    alias :original_except :except

    def except(*keys)
      excepted = original_except(*keys)
      class << excepted
        def inspect
          "\n#{ai(plain: !ActionController::LogSubscriber.colorize_logging)}"
        end
      end
      excepted
    end
  end
  replaced
end