7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/httplog/adapters/patron.rb', line 7
def request(action_name, url, , options = {})
log_enabled = HttpLog.url_approved?(url)
if log_enabled
HttpLog.log_request(action_name, url)
HttpLog.()
HttpLog.log_data(options[:data]) end
bm = Benchmark.realtime do
@response = orig_request(action_name, url, , options)
end
if log_enabled
= @response.
HttpLog.log_compact(action_name, url, @response.status, bm)
HttpLog.log_status(@response.status)
HttpLog.log_benchmark(bm)
HttpLog.()
HttpLog.log_body(@response.body, ['Content-Encoding'], ['Content-Type'])
end
@response
end
|