Sha256: e00ec3a6fb24f47c70a1a2b93540b850a4b54ac9e1239885f678fbee2dc4719c

Contents?: true

Size: 315 Bytes

Versions: 5

Compression:

Stored size: 315 Bytes

Contents

class Mongoid::Search::Log
  cattr_accessor :silent

  def self.log(message)
    print message unless silent
  end

  def self.red(text)
    log(colorize(text, 31))
  end

  def self.green(text)
    log(colorize(text, 32))
  end

  private
  def self.colorize(text, code)
    "\033[#{code}m#{text}\033[0m"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mongoid_search-0.3.4 lib/mongoid_search/log.rb
mongoid_search-0.3.3 lib/mongoid_search/log.rb
mongoid_search-0.3.2 lib/mongoid_search/log.rb
mongoid_search-0.3.1 lib/mongoid_search/log.rb
mongoid_search-0.3.0 lib/mongoid_search/log.rb