lib/hanami/web/rack_logger.rb in hanami-2.1.0 vs lib/hanami/web/rack_logger.rb in hanami-2.2.0.beta1
- old
+ new
@@ -33,12 +33,12 @@
private_constant :ROUTER_PARAMS
CONTENT_LENGTH = "CONTENT_LENGTH"
private_constant :CONTENT_LENGTH
- MILISECOND = "ms"
- private_constant :MILISECOND
+ MILLISECOND = "ms"
+ private_constant :MILLISECOND
MICROSECOND = "µs"
private_constant :MICROSECOND
# Dynamic extension used in development and test environments
@@ -77,10 +77,10 @@
def compatible_logger?(logger)
logger.respond_to?(:tagged) && accepts_entry_payload?(logger)
end
def accepts_entry_payload?(logger)
- logger.method(:info).parameters.last.then { |type, _| type == :keyrest }
+ logger.method(:info).parameters.any? { |(type, _)| type == :keyrest }
end
end
# @since 2.1.0
# @api private