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
-
#logger ⇒ Object
Fallback to STDOUT logger for non-rails applications Usage examples to logging details in RecurlyApi:Client a.
Instance Method Summary collapse
- #logger_cache_heading ⇒ Object
-
#logger_heading ⇒ Object
Classical set method(instead used attr_writer) def logger=(logger) @logger = logger end.
Instance Attribute Details
#logger ⇒ Object
Fallback to STDOUT logger for non-rails applications Usage examples to logging details in RecurlyApi:Client
-
logger.info(“I’m an info log”)
-
logger.warn(“I’m a warn log”)
-
logger.error(“I’m an error log: error message”)
-
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_heading ⇒ Object
29 30 31 |
# File 'lib/recurly_api/logging.rb', line 29 def logger_cache_heading "#{logger_heading} CACHING" end |
#logger_heading ⇒ Object
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 |