Module: Logging

Included in:
Rover
Defined in:
lib/rover.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.loggerObject

Global, memoized, lazy initialized instance of a logger



31
32
33
34
35
36
37
38
# File 'lib/rover.rb', line 31

def self.logger
  @logger ||= begin
    logger = Logger.new(STDOUT)
    logger.level = ENV['ROVER_VERBOSE'] ? Logger::INFO : Logger::FATAL

    logger
  end
end

Instance Method Details

#loggerObject

This is the magical bit that gets mixed into your classes



26
27
28
# File 'lib/rover.rb', line 26

def logger
  Logging.logger
end