Class: Omise::HTTPLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/omise/http_logger.rb

Constant Summary collapse

LABEL =
"[Omise]".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logger = nil) ⇒ HTTPLogger

Returns a new instance of HTTPLogger.



5
6
7
# File 'lib/omise/http_logger.rb', line 5

def initialize(logger = nil)
  @logger = logger
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



9
10
11
# File 'lib/omise/http_logger.rb', line 9

def logger
  @logger
end

Instance Method Details

#log_request(request) ⇒ Object



11
12
13
# File 'lib/omise/http_logger.rb', line 11

def log_request(request)
  info(format_request(request))
end

#log_response(response) ⇒ Object



15
16
17
# File 'lib/omise/http_logger.rb', line 15

def log_response(response)
  info(format_response(response))
end