Module: ActiveSupport::LoggerThreadSafeLevel
- Extended by:
- Concern
- Included in:
- Logger
- Defined in:
- lib/active_support/logger_thread_safe_level.rb
Overview
Instance Method Summary
collapse
Methods included from Concern
append_features, class_methods, extended, included
Instance Method Details
#after_initialize ⇒ Object
10
11
12
|
# File 'lib/active_support/logger_thread_safe_level.rb', line 10
def after_initialize
@local_levels = Concurrent::Map.new(initial_capacity: 2)
end
|
30
31
32
|
# File 'lib/active_support/logger_thread_safe_level.rb', line 30
def level
local_level || super
end
|
#local_level ⇒ Object
18
19
20
|
# File 'lib/active_support/logger_thread_safe_level.rb', line 18
def local_level
@local_levels[local_log_id]
end
|
#local_level=(level) ⇒ Object
22
23
24
25
26
27
28
|
# File 'lib/active_support/logger_thread_safe_level.rb', line 22
def local_level=(level)
if level
@local_levels[local_log_id] = level
else
@local_levels.delete(local_log_id)
end
end
|
#local_log_id ⇒ Object
14
15
16
|
# File 'lib/active_support/logger_thread_safe_level.rb', line 14
def local_log_id
Fiber.current.__id__
end
|