Class: UnionPay::Core::Logger::NetLog

Inherits:
Object
  • Object
show all
Defined in:
lib/union-pay/core/logger.rb

Instance Method Summary collapse

Constructor Details

#initializeNetLog

Returns a new instance of NetLog.



13
14
15
16
17
18
19
# File 'lib/union-pay/core/logger.rb', line 13

def initialize
  if defined?(Rails)
    @logger = Rails.logger
  else
    @logger = ::Logger.new(STDOUT)
  end
end

Instance Method Details

#log(req, resp, notice = false) ⇒ Object



21
22
23
# File 'lib/union-pay/core/logger.rb', line 21

def log(req, resp, notice=false)
  @logger.info("unionpay req: #{req.inspect} -- resp: #{resp.inspect} -- notice:#{notice.inspect}")
end