123456789_123456789_123456789_123456789_123456789_

Module: ActiveSupport::LoggerThreadSafeLevel

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Concern
Defined in: activesupport/lib/active_support/logger_thread_safe_level.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#local_level (rw)

[ GitHub ]

  
# File 'activesupport/lib/active_support/logger_thread_safe_level.rb', line 16

def local_level
  @local_levels[local_log_id]
end

#local_level=(level) (rw)

[ GitHub ]

  
# File 'activesupport/lib/active_support/logger_thread_safe_level.rb', line 20

def local_level=(level)
  if level
    @local_levels[local_log_id] = level
  else
    @local_levels.delete(local_log_id)
  end
end

Instance Method Details

#after_initialize

[ GitHub ]

  
# File 'activesupport/lib/active_support/logger_thread_safe_level.rb', line 8

def after_initialize
  @local_levels = ThreadSafe::Cache.new
end

#level

[ GitHub ]

  
# File 'activesupport/lib/active_support/logger_thread_safe_level.rb', line 28

def level
  local_level || super
end

#local_log_id

[ GitHub ]

  
# File 'activesupport/lib/active_support/logger_thread_safe_level.rb', line 12

def local_log_id
  Thread.current.__id__
end