lib/instana/secrets.rb in instana-1.195.4 vs lib/instana/secrets.rb in instana-1.197.0.pre1

- old
+ new

@@ -4,10 +4,14 @@ require 'uri' require 'cgi' module Instana class Secrets + def initialize(logger: ::Instana.logger) + @logger = logger + end + def remove_from_query(str, secret_values = Instana.agent.secret_values) return str unless secret_values url = URI(str) params = url.scheme ? CGI.parse(url.query || '') : CGI.parse(url.to_s) @@ -35,11 +39,11 @@ when 'contains' ->(expected, actual) { actual.include?(expected) } when 'regex' ->(expected, actual) { !Regexp.new(expected).match(actual).nil? } else - ::Instana.logger.warn("Matcher #{name} is not supported.") - lambda { false } + @logger.warn("Matcher #{name} is not supported.") + ->(_e, _a) { false } end end end end