Module: Brightbox::Logging::MixinMethods
- Defined in:
- lib/brightbox-cli/logging.rb
Instance Method Summary collapse
- #data(log_msg) ⇒ Object
- #debug(log_msg) ⇒ Object
- #error(log_msg = "") ⇒ Object
- #info(log_msg = "") ⇒ Object
- #warn(log_msg = "") ⇒ Object
Instance Method Details
#data(log_msg) ⇒ Object
25 26 27 28 |
# File 'lib/brightbox-cli/logging.rb', line 25 def data(log_msg) $stdout.write log_msg $stdout.write "\n" end |
#debug(log_msg) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/brightbox-cli/logging.rb', line 30 def debug(log_msg) return unless ENV["DEBUG"] $stderr.write "DEBUG: " $stderr.write log_msg $stderr.write "\n" end |
#error(log_msg = "") ⇒ Object
9 10 11 12 13 |
# File 'lib/brightbox-cli/logging.rb', line 9 def error(log_msg = "") $stderr.write log_msg $stderr.write "\n" $stderr.flush end |
#info(log_msg = "") ⇒ Object
15 16 17 18 19 |
# File 'lib/brightbox-cli/logging.rb', line 15 def info(log_msg = "") $stderr.write log_msg $stderr.write "\n" $stderr.flush end |
#warn(log_msg = "") ⇒ Object
21 22 23 |
# File 'lib/brightbox-cli/logging.rb', line 21 def warn(log_msg = "") info "WARN: #{log_msg}" end |