class Logger
def level=(severity)
Logger#sev_threshold= is an alias for Logger#level=.
logger.level = :error # => :error
logger.level = 'error' # => "error"
logger.level = 3 # => 3
logger.level = Logger::ERROR # => 3
Argument +severity+ may be an integer, a string, or a symbol:
See {Log Level}[rdoc-ref:Logger@Log+Level].
Sets the log level; returns +severity+.
def level=(severity) if severity.is_a?(Integer) @level = severity else case severity.to_s.downcase when 'debug' @level = DEBUG when 'info' @level = INFO when 'warn' @level = WARN when 'error' @level = ERROR when 'fatal' @level = FATAL when 'unknown' @level = UNKNOWN else raise ArgumentError, "invalid log level: #{severity}" end end end