lib/falcon/verbose.rb in falcon-0.22.2 vs lib/falcon/verbose.rb in falcon-0.22.3
- old
+ new
@@ -31,11 +31,11 @@
def annotate(request)
task = Async::Task.current
address = request.remote_address
- @logger.info(request.authority) {"#{request.method} #{request.path} #{request.version} #{request.headers.to_h} from #{address.inspect}"}
+ @logger.info(request) {"Headers: #{request.headers.to_h} from #{address.inspect}"}
task.annotate("#{request.method} #{request.path} from #{address.inspect}")
end
def call(request)
@@ -44,12 +44,12 @@
statistics = Async::HTTP::Statistics.start
response = super
statistics.wrap(response) do |statistics, error|
- @logger.info(request.authority) {"#{request.method} #{request.path} #{request.version} -> #{response.status} #{response.headers.to_h}; #{statistics.inspect}"}
+ @logger.info(request) {"Responding with: #{response.status} #{response.headers.to_h}; #{statistics.inspect}"}
- @logger.error(request.authority) {"#{error.class}: #{error.message}"} if error
+ @logger.error(request) {"#{error.class}: #{error.message}"} if error
end
return response
end
end