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.9.2 lib/logging/nutella_logger.rb
nutella_framework-0.9.1 lib/logging/nutella_logger.rb
nutella_framework-0.9.0 lib/logging/nutella_logger.rb
nutella_framework-0.8.0 lib/logging/nutella_logger.rb
nutella_framework-0.7.3 lib/logging/nutella_logger.rb
nutella_framework-0.7.2 lib/logging/nutella_logger.rb
nutella_framework-0.7.1 lib/logging/nutella_logger.rb
nutella_framework-0.7.0 lib/logging/nutella_logger.rb
nutella_framework-0.6.21 lib/logging/nutella_logger.rb
nutella_framework-0.6.20 lib/logging/nutella_logger.rb
nutella_framework-0.6.19 lib/logging/nutella_logger.rb
nutella_framework-0.6.18 lib/logging/nutella_logger.rb
nutella_framework-0.6.17 lib/logging/nutella_logger.rb
nutella_framework-0.6.16 lib/logging/nutella_logger.rb
nutella_framework-0.6.15 lib/logging/nutella_logger.rb
nutella_framework-0.6.13 lib/logging/nutella_logger.rb
nutella_framework-0.6.12 lib/logging/nutella_logger.rb
nutella_framework-0.6.11 lib/logging/nutella_logger.rb
nutella_framework-0.6.10 lib/logging/nutella_logger.rb
nutella_framework-0.6.9 lib/logging/nutella_logger.rb