lib/semantic_logger/base.rb in semantic_logger-4.15.0 vs lib/semantic_logger/base.rb in semantic_logger-4.16.0
- old
+ new
@@ -340,12 +340,13 @@
end
# Add result of block to message or payload if not nil
if block_given?
result = yield(log)
- if result.is_a?(String)
+ case result
+ when String
log.message = log.message.nil? ? result : "#{log.message} -- #{result}"
- elsif result.is_a?(Hash)
+ when Hash
log.assign_hash(result)
end
end
# Log level may change during assign due to :on_exception_level