Module: Dry::Logger::ExecutionContext Private
- Defined in:
- lib/dry/logger/execution_context.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Provides isolated thread-local storage for logger values.
Constant Summary collapse
- CONTEXT_KEY =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
:__dry_logger__
Class Method Summary collapse
-
.[](key) ⇒ Object?
private
Returns a value from the current execution context.
-
.[]=(key, value) ⇒ Object
private
Sets a value in the current execution context.
-
.clear ⇒ self
private
Clears all values from the current execution context.
Class Method Details
.[](key) ⇒ Object?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a value from the current execution context.
17 18 19 |
# File 'lib/dry/logger/execution_context.rb', line 17 def [](key) context[key] end |
.[]=(key, value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Sets a value in the current execution context.
27 28 29 |
# File 'lib/dry/logger/execution_context.rb', line 27 def []=(key, value) context[key] = value end |
.clear ⇒ self
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Clears all values from the current execution context.
34 35 36 37 |
# File 'lib/dry/logger/execution_context.rb', line 34 def clear current_store[CONTEXT_KEY] = {} self end |