Class: Savon::RequestLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/savon/request_logger.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


23
24
25
# File 'lib/savon/request_logger.rb', line 23

def log?
  @globals[:log]
end

#log_headers?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/savon/request_logger.rb', line 27

def log_headers?
  @globals[:log_headers]
end

#loggerObject



19
20
21
# File 'lib/savon/request_logger.rb', line 19

def logger
  @globals[:logger]
end