Sha256: 28f212af99b50bf2bd06657e23f6775d878f3041d222f82f0ad482600886201b

Contents?: true

Size: 465 Bytes

Versions: 25

Compression:

Stored size: 465 Bytes

Contents

require 'colored'

module Wordmove
  class Logger

    ERROR = 0
    INFO = 1
    VERBOSE = 2

    attr_accessor :level

    def log(l, message)
      colors = [ :red, :green, :cyan ]
      if l <= level
        puts "  " * [l-1, 0].max + message.send(colors[l])
      end
    end

    def info(message)
      log INFO, message
    end

    def verbose(message)
      log VERBOSE, message
    end

    def error(message)
      log ERROR, message
    end

  end
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
wordmove-0.0.8 lib/wordmove/logger.rb
wordmove-0.0.7 lib/wordmove/logger.rb
wordmove-0.0.6 lib/wordmove/logger.rb
wordmove-sshbump-0.2.2 lib/wordmove/logger.rb
wordmove-sshbump-0.2.1 lib/wordmove/logger.rb
wordmove-sshbump-0.2.0 lib/wordmove/logger.rb
wordmove-sshbump-0.1.9 lib/wordmove/logger.rb
wordmove-sshbump-0.1.8 lib/wordmove/logger.rb
wordmove-sshbump-0.1.7 lib/wordmove/logger.rb
wordmove-sshbump-0.1.6 lib/wordmove/logger.rb
wordmove-sshbump-0.1.5 lib/wordmove/logger.rb
wordmove-sshbump-0.1.4 lib/wordmove/logger.rb
wordmove-sshbump-0.1.3 lib/wordmove/logger.rb
wordmove-sshbump-0.1.2 lib/wordmove/logger.rb
wordmove-sshbump-0.1.1 lib/wordmove/logger.rb
wordmove-sshbump-0.1.0 lib/wordmove/logger.rb
wordmove-sshbump-0.0.10 lib/wordmove/logger.rb
wordmove-sshbump-0.0.9 lib/wordmove/logger.rb
wordmove-sshbump-0.0.8 lib/wordmove/logger.rb
wordmove-sshbump-0.0.7 lib/wordmove/logger.rb