Class: Skytap::Logger
- Inherits:
-
Object
- Object
- Skytap::Logger
- Defined in:
- lib/skytap/logger.rb
Instance Attribute Summary collapse
-
#log_level ⇒ Object
Returns the value of attribute log_level.
Instance Method Summary collapse
- #debug(msg = '', options = {}) ⇒ Object
-
#info(msg = '', options = {}) ⇒ Object
The message is logged unless the –quiet option is present.
-
#initialize(log_level) ⇒ Logger
constructor
A new instance of Logger.
- #mute! ⇒ Object
- #muted? ⇒ Boolean
-
#puts(msg = '', options = {}) ⇒ Object
The message is logged unconditionally.
- #unmute! ⇒ Object
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_level ⇒ Object
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 = '', = {}) if log_level == 'verbose' do_log(msg, ) 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 = '', = {}) if log_level == 'info' || log_level == 'verbose' do_log(msg, ) end end |
#mute! ⇒ Object
27 28 29 |
# File 'lib/skytap/logger.rb', line 27 def mute! @muted = true end |
#muted? ⇒ 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 = '', = {}) do_log(msg, ) end |
#unmute! ⇒ Object
31 32 33 |
# File 'lib/skytap/logger.rb', line 31 def unmute! @muted = false end |