1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
# frozen_string_literal: true
require "dry/logger/formatters/structured"
module Dry
module Logger
module Formatters
# Special handling of `:params` in the log entry payload
#
# @since 1.0.0
# @api private
#
# @see String
class Rack < String
# @see String#initialize
# @since 1.0.0
# @api private
def initialize(**options)
super
@template = Template[Logger.templates[:rack]]
end
# @api 1.0.0
# @api private
def format_params(value)
return value unless value.empty?
end
end
end
end
end
|