Sha256: 83727fa673b0995be77ae128e2dc69664b140470eab92037081c25582bc3f12f

Contents?: true

Size: 628 Bytes

Versions: 2

Compression:

Stored size: 628 Bytes

Contents

require 'logger'
require 'colorize'
require 'colorized_string'

module CartBinaryUploader
  class CartLogger
    class << self
      def log
        if @logger.nil?
          @logger = Logger.new STDOUT
          @logger.level = Logger::DEBUG
          @logger.datetime_format = '%Y-%m-%d %H:%M:%S '
        end
        @logger
      end

      def log_info string
        CartLogger.log.info string
      end

      def log_warn string
        CartLogger.log.warn string
      end

      def log_error string
        CartLogger.log.error string.to_s.colorize(:color => :white, :background => :red)
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cartup-1.0.1 lib/cart_logger.rb
cartup-1.0.0 lib/cart_logger.rb