class Focuslight::Logger::Config

Public Class Methods

log_level(log_level = Focuslight::Config.get(:log_level)) click to toggle source
# File lib/focuslight/logger.rb, line 52
def self.log_level(log_level = Focuslight::Config.get(:log_level))
  case log_level
  when 'debug'
    ::Logger::DEBUG
  when 'info'
    ::Logger::INFO
  when 'warn'
    ::Logger::WARN
  when 'error'
    ::Logger::ERROR
  when 'fatal'
    ::Logger::FATAL
  else
    raise ArgumentError, "invalid log_level #{log_level}"
  end
end
log_path(log_path = Focuslight::Config.get(:log_path)) click to toggle source
# File lib/focuslight/logger.rb, line 41
def self.log_path(log_path = Focuslight::Config.get(:log_path))
  case log_path
  when 'STDOUT'
    $stdout
  when 'STDERR'
    $stderr
  else
    log_path
  end
end
log_shift_age(log_shift_age = Focuslight::Config.get(:log_shift_age)) click to toggle source
# File lib/focuslight/logger.rb, line 69
def self.log_shift_age(log_shift_age = Focuslight::Config.get(:log_shift_age))
  case log_shift_age
  when /\d+/
    log_shift_age.to_i
  when 'daily'
    log_shift_age
  when 'weekly'
    log_shift_age
  when 'monthly'
    log_shift_age
  else
    raise ArgumentError, "invalid log_shift_age #{log_shift_age}"
  end
end
log_shift_size(log_shift_size = Focuslight::Config.get(:log_shift_size)) click to toggle source
# File lib/focuslight/logger.rb, line 84
def self.log_shift_size(log_shift_size = Focuslight::Config.get(:log_shift_size))
  log_shift_size.to_i
end