Class: Versacommerce::CLI::SimpleLogger
- Inherits:
-
Object
- Object
- Versacommerce::CLI::SimpleLogger
- Defined in:
- lib/versacommerce/cli/simple_logger.rb
Instance Attribute Summary collapse
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
- #debug(*messages) ⇒ Object
- #error(*messages) ⇒ Object
- #info(*messages) ⇒ Object
-
#initialize(verbose) ⇒ SimpleLogger
constructor
A new instance of SimpleLogger.
- #success(*messages) ⇒ Object
Constructor Details
#initialize(verbose) ⇒ SimpleLogger
Returns a new instance of SimpleLogger.
8 9 10 |
# File 'lib/versacommerce/cli/simple_logger.rb', line 8 def initialize(verbose) @verbose = verbose end |
Instance Attribute Details
#verbose ⇒ Object
Returns the value of attribute verbose.
6 7 8 |
# File 'lib/versacommerce/cli/simple_logger.rb', line 6 def verbose @verbose end |
Instance Method Details
#debug(*messages) ⇒ Object
16 17 18 |
# File 'lib/versacommerce/cli/simple_logger.rb', line 16 def debug(*) write(*) if verbose end |
#error(*messages) ⇒ Object
25 26 27 28 |
# File 'lib/versacommerce/cli/simple_logger.rb', line 25 def error(*) = .map { |msg| msg.colorize(:red) } write(*) end |
#info(*messages) ⇒ Object
12 13 14 |
# File 'lib/versacommerce/cli/simple_logger.rb', line 12 def info(*) write(*) end |
#success(*messages) ⇒ Object
20 21 22 23 |
# File 'lib/versacommerce/cli/simple_logger.rb', line 20 def success(*) = .map { |msg| msg.colorize(:green) } write(*) end |