Class: CartBinaryUploader::CartLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/cart_logger.rb

Class Method Summary collapse

Class Method Details

.logObject



8
9
10
11
12
13
14
15
# File 'lib/cart_logger.rb', line 8

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

.log_error(string) ⇒ Object



25
26
27
# File 'lib/cart_logger.rb', line 25

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

.log_info(string) ⇒ Object



17
18
19
# File 'lib/cart_logger.rb', line 17

def log_info string
  CartLogger.log.info string
end

.log_warn(string) ⇒ Object



21
22
23
# File 'lib/cart_logger.rb', line 21

def log_warn string
  CartLogger.log.warn string
end