Class: Dry::Logger::Filter Private
- Inherits:
-
Object
- Object
- Dry::Logger::Filter
- Defined in:
- lib/dry/logger/filter.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Filtering logic Originaly copied from hanami/utils (see Hanami::Logger)
Instance Method Summary collapse
- #call(hash) ⇒ Object private
-
#initialize(filters = []) ⇒ Filter
constructor
private
A new instance of Filter.
Constructor Details
#initialize(filters = []) ⇒ Filter
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 new instance of Filter.
13 14 15 |
# File 'lib/dry/logger/filter.rb', line 13 def initialize(filters = []) @filters = filters end |
Instance Method Details
#call(hash) ⇒ 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.
19 20 21 22 23 24 25 26 |
# File 'lib/dry/logger/filter.rb', line 19 def call(hash) _filtered_keys(hash).each do |key| *keys, last = _actual_keys(hash, key.split(".")) keys.inject(hash, :fetch)[last] = "[FILTERED]" end hash end |