Method: ActiveSupport::LoggerThreadSafeLevel#local_level=

Defined in:
lib/active_support/logger_thread_safe_level.rb

#local_level=(level) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/active_support/logger_thread_safe_level.rb', line 22

def local_level=(level)
  case level
  when Integer
  when Symbol
    level = Logger::Severity.const_get(level.to_s.upcase)
  when nil
  else
    raise ArgumentError, "Invalid log level: #{level.inspect}"
  end
  if level.nil?
    IsolatedExecutionState.delete(local_level_key)
  else
    IsolatedExecutionState[local_level_key] = level
  end
end