Class: Zold::Log

Inherits:
Object
  • Object
show all
Defined in:
lib/zold/log.rb

Overview

Logging

Defined Under Namespace

Classes: Quiet, Verbose

Constant Summary collapse

MUTEX =
Mutex.new

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details



33
34
35
36
37
# File 'lib/zold/log.rb', line 33

def self.print(text)
  MUTEX.synchronize do
    puts(text)
  end
end

Instance Method Details

#debug(msg) ⇒ Object



39
40
41
# File 'lib/zold/log.rb', line 39

def debug(msg)
  # nothing
end

#debug?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/zold/log.rb', line 43

def debug?
  false
end

#error(msg) ⇒ Object



55
56
57
# File 'lib/zold/log.rb', line 55

def error(msg)
  Log.print("#{Rainbow('ERROR').red}: #{msg}")
end

#info(msg) ⇒ Object



47
48
49
# File 'lib/zold/log.rb', line 47

def info(msg)
  Log.print(msg)
end

#info?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/zold/log.rb', line 51

def info?
  true
end