Class: RubyCrystalCodemod::Logger
- Inherits:
-
Object
- Object
- RubyCrystalCodemod::Logger
- Defined in:
- lib/ruby_crystal_codemod/logger.rb
Constant Summary collapse
- LEVELS =
{ silent: 0, error: 1, warn: 2, log: 3, debug: 4, }
Instance Method Summary collapse
- #debug(*args) ⇒ Object
- #error(*args) ⇒ Object
-
#initialize(level) ⇒ Logger
constructor
A new instance of Logger.
- #log(*args) ⇒ Object
- #warn(*args) ⇒ Object
Constructor Details
Instance Method Details
#debug(*args) ⇒ Object
15 16 17 |
# File 'lib/ruby_crystal_codemod/logger.rb', line 15 def debug(*args) $stdout.puts(*args) if should_output?(:debug) end |
#error(*args) ⇒ Object
27 28 29 |
# File 'lib/ruby_crystal_codemod/logger.rb', line 27 def error(*args) $stderr.puts(*args) if should_output?(:error) end |
#log(*args) ⇒ Object
19 20 21 |
# File 'lib/ruby_crystal_codemod/logger.rb', line 19 def log(*args) $stdout.puts(*args) if should_output?(:log) end |
#warn(*args) ⇒ Object
23 24 25 |
# File 'lib/ruby_crystal_codemod/logger.rb', line 23 def warn(*args) $stderr.puts(*args) if should_output?(:warn) end |