Logging external http api calls in Rails log

Http api calls are pretty similar to SQL queries – they query data from external source make it available in ruby. So I think it’s a good idea to track them in the Rails logger just like ActiveRecord does with SQL queries.
This simple peace of code could be very helpful in case of debugging HTTP api. Installation is pretty simple:AndIn rails you don’t have to do anything, as defaults are: TODO for v2:

Offtop for ruby lovers

Want to show the most interesting part in the source code:Pay attention on how ensure works with context. The response local variable defined inside of def and ensure, but still accessible after ensure if there was no exception inside of request_without_log. This would never be possible in static programming language.