Class: Happo::Logger
- Inherits:
-
Object
- Object
- Happo::Logger
- Defined in:
- lib/happo/logger.rb
Overview
Used for all CLI output
Instance Method Summary collapse
-
#cyan(str) ⇒ Object
Mark the string in cyan.
-
#initialize(out = STDOUT) ⇒ Logger
constructor
A new instance of Logger.
-
#log(str, newline = true) ⇒ Object
Print the specified output.
Constructor Details
#initialize(out = STDOUT) ⇒ Logger
Returns a new instance of Logger.
5 6 7 |
# File 'lib/happo/logger.rb', line 5 def initialize(out = STDOUT) @out = out end |
Instance Method Details
#cyan(str) ⇒ Object
Mark the string in cyan
19 20 21 |
# File 'lib/happo/logger.rb', line 19 def cyan(str) color(36, str) end |
#log(str, newline = true) ⇒ Object
Print the specified output
12 13 14 15 |
# File 'lib/happo/logger.rb', line 12 def log(str, newline = true) @out.print(str) @out.print("\n") if newline end |