Class: LogMe::HttpFormatter
- Inherits:
-
Object
- Object
- LogMe::HttpFormatter
- Defined in:
- lib/logme/http_formatter.rb
Instance Method Summary collapse
Instance Method Details
#format_request(request, url) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/logme/http_formatter.rb', line 4 def format_request(request, url) = (request) do = with_line_break { 'Request:' } << with_line_break { "#{request.method.to_s.upcase} #{url}" } end end |
#format_response(response) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/logme/http_formatter.rb', line 11 def format_response(response) = (response) do = with_line_break { 'Response:' } << with_line_break { "HTTP/#{response.http_version} #{response.code} #{response.message}" } end end |