Class: Strava::Logger

Inherits:
Logger
  • Object
show all
Defined in:
lib/strava/logger.rb

Overview

Default logger for the Strava client library.

Extends the standard Ruby Logger class and provides a default logger instance configured to output warnings and errors to STDOUT. The logger can be customized via the Web configuration to control HTTP request/response logging.

Examples:

Using the default logger

Strava::Logger.logger.info('Making API request')

Customizing the logger

Strava::Web.configure do |config|
  config.logger = Logger.new('strava.log')
end

See Also:

Class Method Summary collapse

Class Method Details

.loggerStrava::Logger

Returns the default logger instance.

Creates a memoized logger that outputs to STDOUT with a default log level of WARN. This logger is used by default for HTTP request logging unless overridden in the configuration.

Returns:



34
35
36
37
38
39
40
# File 'lib/strava/logger.rb', line 34

def self.logger
  @logger ||= begin
    logger = new $stdout
    logger.level = Logger::WARN
    logger
  end
end