Module: WhatupLogger

Included in:
Whatup::Server::DbInit, Whatup::Server::Server
Defined in:
lib/whatup/server/logger.rb

Instance Method Summary collapse

Instance Method Details

#logObject

Access a logger, to stdout (for now).

Uses logging level ENV, which can be WARN, INFO, etc



28
29
30
31
32
33
34
35
36
37
# File 'lib/whatup/server/logger.rb', line 28

def log
  Logger.new(STDOUT).tap do |logger|
    if Logger.constants.map(&:to_s).include? ENV['WHATUP_LOG_LEVEL']
      logger.level = Logger.const_get ENV['WHATUP_LOG_LEVEL']
    else
      logger.level = Logger::INFO
      logger.level = 9001 if Whatup.testing?
    end
  end
end