Class: GALogger
- Inherits:
-
Object
- Object
- GALogger
- Defined in:
- lib/ga_logger.rb
Overview
Class Method Summary collapse
-
.log(message, type = :Default, padding = ' ### ') ⇒ Object
Logs a message on the console.
-
.sequenceForType(type) ⇒ Object
Returns the character code to print with the right color given a message type.
Class Method Details
.log(message, type = :Default, padding = ' ### ') ⇒ Object
Note:
depending on the message type, a different color will be used to print the message on the console
Logs a message on the console
15 16 17 |
# File 'lib/ga_logger.rb', line 15 def self.log(, type = :Default, padding = ' ### ') puts sequenceForType(type) + padding + + padding + sequenceForType(:Default) end |
.sequenceForType(type) ⇒ Object
Returns the character code to print with the right color given a message type
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/ga_logger.rb', line 22 def self.sequenceForType(type) case type when :Success return "\033[32m" when :Error return "\033[31m" when :Warning return "\033[33m" else return "\033[0m" end end |