Class: Savon::RequestLogger
- Inherits:
-
Object
- Object
- Savon::RequestLogger
- Defined in:
- lib/savon/request_logger.rb
Instance Method Summary collapse
-
#initialize(globals) ⇒ RequestLogger
constructor
A new instance of RequestLogger.
- #log(request, &http_request) ⇒ Object
- #log? ⇒ Boolean
- #log_headers? ⇒ Boolean
- #logger ⇒ Object
Constructor Details
#initialize(globals) ⇒ RequestLogger
Returns a new instance of RequestLogger.
7 8 9 |
# File 'lib/savon/request_logger.rb', line 7 def initialize(globals) @globals = globals end |
Instance Method Details
#log(request, &http_request) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/savon/request_logger.rb', line 11 def log(request, &http_request) log_request(request) if log? response = http_request.call log_response(response) if log? response end |
#log? ⇒ Boolean
23 24 25 |
# File 'lib/savon/request_logger.rb', line 23 def log? @globals[:log] end |
#log_headers? ⇒ Boolean
27 28 29 |
# File 'lib/savon/request_logger.rb', line 27 def log_headers? @globals[:log_headers] end |
#logger ⇒ Object
19 20 21 |
# File 'lib/savon/request_logger.rb', line 19 def logger @globals[:logger] end |