vendor/bundle/ruby/2.6.0/gems/lumberjack-1.2.8/lib/lumberjack/tag_formatter.rb
def format(tags)
      return nil if tags.nil?
      if @default_formatter.nil? && (@formatters.empty? || (@formatters.keys & tags.keys).empty?)
        tags
      else
        formatted = {}
        tags.each do |name, value|
          formatter = (@formatters[name.to_s] || @default_formatter)
          if formatter.is_a?(Lumberjack::Formatter)
            value = formatter.format(value)
          elsif formatter.respond_to?(:call)
            value = formatter.call(value)
          end
          formatted[name.to_s] = value
        end
        formatted
      end
    end
# Format a hash of tags using the formatters
Format a hash of tags using the formatters
Format a hash of tags using the formatters
def format(tags)
      return nil if tags.nil?
      if @default_formatter.nil? && (@formatters.empty? || (@formatters.keys & tags.keys).empty?)
        tags
      else
        formatted = {}
        tags.each do |name, value|
          formatter = (@formatters[name.to_s] || @default_formatter)
          if formatter.is_a?(Lumberjack::Formatter)
            value = formatter.format(value)
          elsif formatter.respond_to?(:call)
            value = formatter.call(value)
          end
          formatted[name.to_s] = value
        end
        formatted
      end
    end
def format ( tags ) return nil if tags . nil? if @default_formatter . nil? && ( @formatters . empty? || ( @formatters . keys & tags . keys ) . empty? ) tags else formatted = { } tags . each do | name , value | formatter = ( @formatters [ name . to_s ] || @default_formatter ) if formatter . is_a? ( Lumberjack :: Formatter ) value = formatter . format ( value ) elsif formatter . respond_to? ( :call ) value = formatter . call ( value ) end formatted [ name . to_s ] = value end formatted end end
Format a hash of tags using the formatters
Format a hash of tags using the formatters
tags