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.
11 12 13 |
# File 'lib/dry/logger/filter.rb', line 11 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.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/dry/logger/filter.rb', line 16 def call(hash) hash = _deep_dup(hash) _filtered_keys(hash).each do |key| *keys, last = _actual_keys(hash, key.split(".")) keys.inject(hash, :fetch)[last] = "[FILTERED]" end hash end |