Class: Backy::Logger
- Inherits:
-
Object
- Object
- Backy::Logger
- Defined in:
- lib/backy/logger.rb
Class Method Summary collapse
- .error(message) ⇒ Object
- .info(message) ⇒ Object
-
.log(message, color = nil) ⇒ Object
Logs a message with the specified color using Thor’s shell.
- .log_messages ⇒ Object
- .say(message, color = nil) ⇒ Object
- .success(message) ⇒ Object
- .warn(message) ⇒ Object
Class Method Details
.error(message) ⇒ Object
25 26 27 |
# File 'lib/backy/logger.rb', line 25 def self.error() log(, :red) end |
.info(message) ⇒ Object
17 18 19 |
# File 'lib/backy/logger.rb', line 17 def self.info() log(, :blue) end |
.log(message, color = nil) ⇒ Object
Logs a message with the specified color using Thor’s shell
8 9 10 11 |
# File 'lib/backy/logger.rb', line 8 def self.log(, color = nil) @log_messages << say("[#{Time.now.strftime("%Y-%m-%d %H:%M:%S")}] #{}\n", color) end |
.log_messages ⇒ Object
33 34 35 |
# File 'lib/backy/logger.rb', line 33 def self. @log_messages end |
.say(message, color = nil) ⇒ Object
29 30 31 |
# File 'lib/backy/logger.rb', line 29 def self.say(, color = nil) thor_shell.say(, color) end |
.success(message) ⇒ Object
13 14 15 |
# File 'lib/backy/logger.rb', line 13 def self.success() log(, :green) end |
.warn(message) ⇒ Object
21 22 23 |
# File 'lib/backy/logger.rb', line 21 def self.warn() log(, :yellow) end |