Module: GetaroundUtils::LogFormatters::DeepKeyValue::Shared

Included in:
Base, Patches::KeyValueLogTags::TaggedLoggingFormatter
Defined in:
lib/getaround_utils/log_formatters/deep_key_value.rb

Instance Method Summary collapse

Instance Method Details

#normalize(message) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/getaround_utils/log_formatters/deep_key_value.rb', line 8

def normalize(message)
  if message.is_a?(Hash)
    GetaroundUtils::Utils::DeepKeyValue.serialize(message.compact)
  elsif message.is_a?(String) && message.match(/^[^ =]+=/)
    message
  else
    GetaroundUtils::Utils::DeepKeyValue.serialize(message: message.to_s)
  end
end