Module: RecurlyApi::Logging

Included in:
Client
Defined in:
lib/recurly_api/logging.rb

Overview

fallback to STDOUT for non-rails project

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#loggerObject

Fallback to STDOUT logger for non-rails applications Usage examples to logging details in RecurlyApi:Client

  1. logger.info(“I’m an info log”)

  2. logger.warn(“I’m a warn log”)

  3. logger.error(“I’m an error log: error message”)

  4. logger.fatal(“I’m a fatal log”)



16
17
18
# File 'lib/recurly_api/logging.rb', line 16

def logger
  @logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
end

Instance Method Details

#logger_cache_headingObject



29
30
31
# File 'lib/recurly_api/logging.rb', line 29

def logger_cache_heading
  "#{logger_heading} CACHING"
end

#logger_headingObject

Classical set method(instead used attr_writer) def logger=(logger)

@logger = logger

end



25
26
27
# File 'lib/recurly_api/logging.rb', line 25

def logger_heading
  'tribune_recurly_api'
end