Sha256: b064c0cf87ed29b9da175039f4f674f5973c759c52f0a97e96132317a55be5a3

Contents?: true

Size: 520 Bytes

Versions: 4

Compression:

Stored size: 520 Bytes

Contents

module MidasClient
  module Util

    attr_accessor :logger

    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

4 entries across 4 versions & 1 rubygems

Version Path
midas_client-0.2.4 lib/midas_client/util.rb
midas_client-0.2.1 lib/midas_client/util.rb
midas_client-0.1.4.1 lib/midas_client/util.rb
midas_client-0.1.4 lib/midas_client/util.rb