redacting-logger 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d88bd6e2d2e1c5fc186f05de1c0edb096d69399c6cb341eebfee809e2e46ab05
4
- data.tar.gz: af491b9b0ceb4a9d4800fdd102ae1560c90f4d4eb107dd5e3f6b82da0a03627a
3
+ metadata.gz: 0563c893691556329c50c2b23f43ed5c10de92f9ff07c5e48da1eb0a72b4ced3
4
+ data.tar.gz: 59cb05505414611266e6ef7a12b104fc9757da96eab1383a6a0430b5875c9d57
5
5
  SHA512:
6
- metadata.gz: 1361b56a1c97dac3f910ebbbcb65652caea545bd2178cc12b61ae8725e0c99e4d06a3d6114c94349e1292adc795eb7802127255ffeaaafac8146ea866f8e3804
7
- data.tar.gz: 282b6cb2221ecfa793acee8232da60f0e70c0c9c396889f2dd725b37cd9cb1e7bb67a0159f64c40ada9748b67f849e8ba42aaaa7853fc4907d39df8c588c9ab5
6
+ metadata.gz: 5db3cc688afe4cf2884c9fd09d7841ee300a1fc6029c1e1e408b808d249772b7e41b5b669a93a511f4d45616d423e39f70cebbc241b7a2b53f67e3464f41d67b
7
+ data.tar.gz: 0c354c05a49da638b231a1535adcc2ac204351c248693a09347a2fcee4ee82d663fad30e2a2c2dc0908b1e605fc573d29588b380356a39e0fa970292bc2cf317
@@ -20,7 +20,7 @@ class RedactingLogger < Logger
20
20
  def initialize(
21
21
  logdev = $stdout,
22
22
  shift_age = 0,
23
- shift_size = 1048576,
23
+ shift_size = 1_048_576,
24
24
  redact_patterns: [],
25
25
  redacted_msg: "[REDACTED]",
26
26
  use_default_patterns: true,
@@ -43,18 +43,18 @@ class RedactingLogger < Logger
43
43
  @redact_patterns.each do |pattern|
44
44
  case message
45
45
 
46
- when String
46
+ when String, Symbol, Numeric
47
47
  message = message.to_s.gsub(pattern, @redacted_msg)
48
48
 
49
49
  when Array
50
50
  message = message.map do |m|
51
- m = m.to_s.gsub(pattern, @redacted_msg)
51
+ m.to_s.gsub(pattern, @redacted_msg)
52
52
  end
53
53
 
54
54
  when Hash
55
- message = message.map do |k, v|
56
- [k, v.to_s.gsub(pattern, @redacted_msg)]
57
- end.to_h
55
+ message = message.transform_values do |v|
56
+ v.to_s.gsub(pattern, @redacted_msg)
57
+ end
58
58
  end
59
59
  end
60
60
 
data/lib/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RedactingLogger
4
4
  module Version
5
- VERSION = "1.1.0"
5
+ VERSION = "1.2.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redacting-logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-12-18 00:00:00.000000000 Z
12
+ date: 2024-02-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: logger