Module: Nesta::Plugin::Drop

Defined in:
lib/nesta-plugin-drop/client.rb,
lib/nesta-plugin-drop/logger.rb,
lib/nesta-plugin-drop/routes.rb,
lib/nesta-plugin-drop/helpers.rb,
lib/nesta-plugin-drop/version.rb

Defined Under Namespace

Modules: Helpers, Routes Classes: Client

Constant Summary collapse

VERSION =
"0.0.15"

Class Method Summary collapse

Class Method Details

.loggerObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/nesta-plugin-drop/logger.rb', line 5

def self.logger
  return @logger if @logger
  @logger = Logger.new(STDOUT)
  @logger.level = Logger::WARN
  if level = ENV["NESTADROP_LOG_LEVEL"]
    levels = ["FATAL", "ERROR", "WARN", "INFO", "DEBUG"]
    if levels.include? level.upcase
      @logger.level = Logger.const_get(level.upcase.to_sym)
    else
      @logger.warn "Log level '#{level.upcase}' is unknown. Supported levels are: #{levels.join(", ")}."
    end
  end
  @logger
end