Sha256: cb59d484f44a4ae351793a71c8ef15434efc044a6a0436f6db8ca696ee91dfe0

Contents?: true

Size: 811 Bytes

Versions: 66

Compression:

Stored size: 811 Bytes

Contents

require 'ansi/code'
require 'logging'

module Nutella
  
  class NutellaLogger
    
    def initialize(name)
      @log = Logging.logger[name]
      @log.add_appenders(Logging.appenders.stdout(
        :layout => Logging.layouts.pattern(:pattern => '%m\n')
        )
      )
    end
    
    def debug(message, code=nil)
      @log.debug(ANSI.cyan + message + ANSI.reset)
      code
    end
    
    def info(message, code=nil)
      @log.info(message)
      code
    end
    
    def success(message, code=nil)
      @log.info(ANSI.green + message + ANSI.reset)
      code
    end
    
    def warn(message, code=nil)
      @log.warn(ANSI.yellow + message + ANSI.reset)
      code
    end
    
    def error(message, code=nil)
      @log.error(ANSI.red + message + ANSI.reset)
      code
    end
    
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
nutella_framework-0.6.8 lib/logging/nutella_logger.rb
nutella_framework-0.6.7 lib/logging/nutella_logger.rb
nutella_framework-0.6.6 lib/logging/nutella_logger.rb
nutella_framework-0.6.5 lib/logging/nutella_logger.rb
nutella_framework-0.6.4 lib/logging/nutella_logger.rb
nutella_framework-0.6.3 lib/logging/nutella_logger.rb
nutella_framework-0.6.2 lib/logging/nutella_logger.rb
nutella_framework-0.6.1 lib/logging/nutella_logger.rb
nutella_framework-0.6.0 lib/logging/nutella_logger.rb
nutella_framework-0.5.1 lib/logging/nutella_logger.rb
nutella_framework-0.5.0 lib/logging/nutella_logger.rb
nutella_framework-0.4.32 lib/logging/nutella_logger.rb
nutella_framework-0.4.31 lib/logging/nutella_logger.rb
nutella_framework-0.4.30 lib/logging/nutella_logger.rb
nutella_framework-0.4.29 lib/logging/nutella_logger.rb
nutella_framework-0.4.28 lib/logging/nutella_logger.rb
nutella_framework-0.4.27 lib/logging/nutella_logger.rb
nutella_framework-0.4.26 lib/logging/nutella_logger.rb
nutella_framework-0.4.25 lib/logging/nutella_logger.rb
nutella_framework-0.4.24 lib/logging/nutella_logger.rb