lib/semantic_logger/base.rb in semantic_logger-2.14.0 vs lib/semantic_logger/base.rb in semantic_logger-2.15.0
- old
+ new
@@ -327,10 +327,13 @@
end
end
# Log message at the specified level
def log_internal(level, index, message=nil, payload=nil, exception=nil, &block)
- if exception.nil? && payload && payload.is_a?(Exception)
+ if exception.nil? && payload.nil? && message.kind_of?(Exception)
+ exception = message
+ message = exception.inspect
+ elsif exception.nil? && payload && payload.is_a?(Exception)
exception = payload
payload = nil
end
if block && (result = block.call)