module PayPal::SDK::Core::Logging
Include Logging
module to provide logger functionality.
Configure logger¶ ↑
Logging.logger = Logger.new(STDERR)
Example¶ ↑
include Logger logger.info "Debug message"
Public Class Methods
logger()
click to toggle source
Get or Create configured logger based on the default environment configuration
# File lib/paypal-sdk/core/logging.rb, line 28 def logger @logger ||= Logger.new(STDERR) end
Public Instance Methods
log_event(message, &block)
click to toggle source
# File lib/paypal-sdk/core/logging.rb, line 18 def log_event(message, &block) start_time = Time.now block.call ensure logger.info sprintf("[%.3fs] %s", Time.now - start_time, message) end
logger()
click to toggle source
Get logger object
# File lib/paypal-sdk/core/logging.rb, line 14 def logger @logger ||= Logging.logger end