Class: Logger
- Inherits:
-
Object
- Object
- Logger
- Defined in:
- lib/deadfinder/logger.rb
Class Method Summary collapse
- .error(text) ⇒ Object
- .found(text) ⇒ Object
- .info(text) ⇒ Object
- .set_silent ⇒ Object
- .silent? ⇒ Boolean
- .sub_done(text) ⇒ Object
- .sub_info(text) ⇒ Object
- .target(text) ⇒ Object
- .unset_silent ⇒ Object
- .verbose(text) ⇒ Object
Class Method Details
.error(text) ⇒ Object
24 25 26 |
# File 'lib/deadfinder/logger.rb', line 24 def self.error(text) puts '⚠︎ '.colorize(:red) + text.to_s unless silent? end |
.found(text) ⇒ Object
40 41 42 |
# File 'lib/deadfinder/logger.rb', line 40 def self.found(text) puts " ✘ #{text}".colorize(:red) unless silent? end |
.info(text) ⇒ Object
20 21 22 |
# File 'lib/deadfinder/logger.rb', line 20 def self.info(text) puts 'ℹ '.colorize(:blue) + text.to_s.colorize(:light_blue) unless silent? end |
.set_silent ⇒ Object
8 9 10 |
# File 'lib/deadfinder/logger.rb', line 8 def self.set_silent @silent = true end |
.silent? ⇒ Boolean
16 17 18 |
# File 'lib/deadfinder/logger.rb', line 16 def self.silent? @silent end |
.sub_done(text) ⇒ Object
36 37 38 |
# File 'lib/deadfinder/logger.rb', line 36 def self.sub_done(text) puts ' ✓ '.colorize(:blue) + text.to_s.colorize(:light_blue) unless silent? end |
.sub_info(text) ⇒ Object
32 33 34 |
# File 'lib/deadfinder/logger.rb', line 32 def self.sub_info(text) puts ' ● '.colorize(:blue) + text.to_s.colorize(:light_blue) unless silent? end |
.target(text) ⇒ Object
28 29 30 |
# File 'lib/deadfinder/logger.rb', line 28 def self.target(text) puts '► '.colorize(:green) + text.to_s.colorize(:light_green) unless silent? end |
.unset_silent ⇒ Object
12 13 14 |
# File 'lib/deadfinder/logger.rb', line 12 def self.unset_silent @silent = false end |
.verbose(text) ⇒ Object
44 45 46 |
# File 'lib/deadfinder/logger.rb', line 44 def self.verbose(text) puts ' ➜ '.colorize(:yellow) + text.to_s.colorize(:light_yellow) unless silent? end |