Class: HTTParty::Logger::CurlFormatter
- Inherits:
-
Object
- Object
- HTTParty::Logger::CurlFormatter
- Defined in:
- lib/httparty/logger/curl_formatter.rb
Overview
:nodoc:
Constant Summary collapse
- TAG_NAME =
HTTParty.name
- OUT =
'>'
- IN =
'<'
Instance Attribute Summary collapse
-
#level ⇒ Object
Returns the value of attribute level.
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
- #format(request, response) ⇒ Object
-
#initialize(logger, level) ⇒ CurlFormatter
constructor
A new instance of CurlFormatter.
Constructor Details
#initialize(logger, level) ⇒ CurlFormatter
Returns a new instance of CurlFormatter.
12 13 14 15 16 |
# File 'lib/httparty/logger/curl_formatter.rb', line 12 def initialize(logger, level) @logger = logger @level = level.to_sym @messages = [] end |
Instance Attribute Details
#level ⇒ Object
Returns the value of attribute level.
10 11 12 |
# File 'lib/httparty/logger/curl_formatter.rb', line 10 def level @level end |
#logger ⇒ Object
Returns the value of attribute logger.
10 11 12 |
# File 'lib/httparty/logger/curl_formatter.rb', line 10 def logger @logger end |
Instance Method Details
#format(request, response) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/httparty/logger/curl_formatter.rb', line 18 def format(request, response) @request = request @response = response log_request log_response logger.public_send level, .join("\n") end |