lib/semantic_logger/formatters/logfmt.rb in semantic_logger-4.11.0 vs lib/semantic_logger/formatters/logfmt.rb in semantic_logger-4.12.0
- old
+ new
@@ -60,10 +60,15 @@
@parsed = @parsed.merge(@raw[:exception])
end
def flatten_log
flattened = @parsed.map do |key, value|
- "#{key}=#{value.to_json}"
+ case value
+ when Hash, Array
+ "#{key}=#{value.to_s.to_json}"
+ else
+ "#{key}=#{value.to_json}"
+ end
end
flattened.join(" ")
end
end