Skip to content

Commit 20366cf

Browse files
committed
added docs page about filtering data
1 parent 54eadef commit 20366cf

File tree

6 files changed

+403
-7
lines changed

6 files changed

+403
-7
lines changed

lib/log_struct/param_filters.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ def summarize_json_attribute(key, data)
4242
sig { params(string: String, include_hash: T::Boolean).returns(T::Hash[Symbol, T.untyped]) }
4343
def summarize_string(string, include_hash)
4444
filtered_string = {
45-
_class: String,
46-
_bytes: string.bytesize
45+
_class: String
4746
}
48-
filtered_string[:_hash] = HashUtils.hash_value(string) if include_hash
47+
if include_hash
48+
filtered_string[:_hash] = HashUtils.hash_value(string)
49+
else
50+
filtered_string[:_bytes] = string.bytesize
51+
end
52+
4953
filtered_string
5054
end
5155

0 commit comments

Comments
 (0)