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