Sha256: aa1071a207194fa8eb446fb85efa6c9b348b2329a8af83d2ca0ea0f96b76b28d

Contents?: true

Size: 493 Bytes

Versions: 2

Compression:

Stored size: 493 Bytes

Contents

module MidasClient
  module Util

    def logger(progname = '[MIDAS_CLIENT]')
      @logger ||= Logger.new($stdout).tap do |log|
        log.progname = progname
      end
    end

    def log(text)
      logger.level = Logger::INFO
      logger.info "#{text}"
    end

    def error_log(text)
      logger.level = Logger::ERROR
      logger.error "#{text}"
    end

    def sanitize_pci(text)
      CreditCardSanitizer.new(replacement_token: '@').sanitize!(text.to_s) || text
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
midas_client-0.1.3.1 lib/midas_client/util.rb
midas_client-0.1.3 lib/midas_client/util.rb