Skip to content

Commit

Permalink
properly pass in shift_age, shift_size and use @redacted_msg
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantBirki committed Nov 15, 2023
1 parent 0b45ad3 commit 423154d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/redacting_logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def initialize(
use_default_patterns: true,
**kwargs
)
super(logdev, **kwargs)
super(logdev, shift_age, shift_size, **kwargs)
@redact_patterns = redact_patterns
@redacted_msg = redacted_msg
@redact_patterns += Patterns::DEFAULT if use_default_patterns
Expand All @@ -42,13 +42,13 @@ def add(severity, message = nil, progname = nil)

if message
@redact_patterns.each do |pattern|
message = message.to_s.gsub(pattern, "[REDACTED]")
message = message.to_s.gsub(pattern, @redacted_msg)
end
end

if progname
@redact_patterns.each do |pattern|
progname = progname.to_s.gsub(pattern, "[REDACTED]")
progname = progname.to_s.gsub(pattern, @redacted_msg)
end
end

Expand Down

0 comments on commit 423154d

Please sign in to comment.