Class: Rage::Configuration::LogContext
- Inherits:
-
Object
- Object
- Rage::Configuration::LogContext
- Defined in:
- lib/rage/configuration.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#<<(block_or_hash) ⇒ Object
(also: #push)
Add a new custom log context object.
-
#delete(block_or_hash) ⇒ Object
Remove a custom log context object.
Instance Method Details
#<<(hash) ⇒ Object #<<(callable) ⇒ Object Also known as: push
Add a new custom log context object. Each context object is evaluated independently and the results are merged into the final log entry.
243 244 245 246 247 248 249 |
# File 'lib/rage/configuration.rb', line 243 def <<(block_or_hash) validate_input!(block_or_hash) @objects << block_or_hash @objects.tap(&:flatten!).tap(&:uniq!) self end |
#delete(block_or_hash) ⇒ Object
Remove a custom log context object.
259 260 261 |
# File 'lib/rage/configuration.rb', line 259 def delete(block_or_hash) @objects.delete(block_or_hash) end |