Class: Conjure::Log

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

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.captureObject

Returns the value of attribute capture.



5
6
7
# File 'lib/conjure/log.rb', line 5

def capture
  @capture
end

.historyObject (readonly)

Returns the value of attribute history.



6
7
8
# File 'lib/conjure/log.rb', line 6

def history
  @history
end

.levelObject

Returns the value of attribute level.



4
5
6
# File 'lib/conjure/log.rb', line 4

def level
  @level
end

Class Method Details

.clearObject



22
23
24
# File 'lib/conjure/log.rb', line 22

def self.clear
  @history = ""
end

.debug(message) ⇒ Object



18
19
20
# File 'lib/conjure/log.rb', line 18

def self.debug(message)
  info message if @level == :debug
end

.info(message) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/conjure/log.rb', line 9

def self.info(message)
  if @capture
    @history ||= ""
    @history << "#{message}\n"
  else
    puts message
  end
end