Class: Skytap::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/skytap/logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(log_level) ⇒ Logger

Returns a new instance of Logger.



5
6
7
# File 'lib/skytap/logger.rb', line 5

def initialize(log_level)
  @log_level = log_level
end

Instance Attribute Details

#log_levelObject

Returns the value of attribute log_level.



3
4
5
# File 'lib/skytap/logger.rb', line 3

def log_level
  @log_level
end

Instance Method Details

#debug(msg = '', options = {}) ⇒ Object



21
22
23
24
25
# File 'lib/skytap/logger.rb', line 21

def debug(msg = '', options = {})
  if log_level == 'verbose'
    do_log(msg, options)
  end
end

#info(msg = '', options = {}) ⇒ Object

The message is logged unless the –quiet option is present.



15
16
17
18
19
# File 'lib/skytap/logger.rb', line 15

def info(msg = '', options = {})
  if log_level == 'info' || log_level == 'verbose'
    do_log(msg, options)
  end
end

#mute!Object



27
28
29
# File 'lib/skytap/logger.rb', line 27

def mute!
  @muted = true
end

#muted?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/skytap/logger.rb', line 35

def muted?
  !!@muted
end

#puts(msg = '', options = {}) ⇒ Object

The message is logged unconditionally.



10
11
12
# File 'lib/skytap/logger.rb', line 10

def puts(msg = '', options = {})
  do_log(msg, options)
end

#unmute!Object



31
32
33
# File 'lib/skytap/logger.rb', line 31

def unmute!
  @muted = false
end