lib/semantic_logger/base.rb in semantic_logger-4.6.0.beta1 vs lib/semantic_logger/base.rb in semantic_logger-4.6.0
- old
+ new
@@ -310,9 +310,12 @@
if message.key?(:message) || message.key?(:payload) || message.key?(:exception) || message.key?(:metric)
log.assign(message)
else
log.assign_positional(nil, message, nil, &block)
end
+ elsif exception.nil? && message && payload && payload.is_a?(Hash) &&
+ (payload.key?(:payload) || payload.key?(:exception) || payload.key?(:metric))
+ log.assign(message: message, **payload)
else
log.assign_positional(message, payload, exception, &block)
end
# Log level may change during assign due to :on_exception_level