Class: AIRefactor::Logger
- Inherits:
-
Object
- Object
- AIRefactor::Logger
- Defined in:
- lib/ai_refactor/logger.rb
Instance Method Summary collapse
- #debug(message) ⇒ Object
- #error(message, bold: false) ⇒ Object
- #info(message) ⇒ Object
-
#initialize(verbose: false, debug: false) ⇒ Logger
constructor
A new instance of Logger.
- #success(message) ⇒ Object
- #verbose(message) ⇒ Object
- #warn(message) ⇒ Object
Constructor Details
#initialize(verbose: false, debug: false) ⇒ Logger
Returns a new instance of Logger.
5 6 7 8 |
# File 'lib/ai_refactor/logger.rb', line 5 def initialize(verbose: false, debug: false) @verbose = verbose @debug = debug end |
Instance Method Details
#debug(message) ⇒ Object
14 15 16 17 |
# File 'lib/ai_refactor/logger.rb', line 14 def debug() return unless @debug puts .colorize(:light_black) end |
#error(message, bold: false) ⇒ Object
32 33 34 |
# File 'lib/ai_refactor/logger.rb', line 32 def error(, bold: false) puts .colorize(color: :red, mode: bold ? :bold : :default) end |
#info(message) ⇒ Object
10 11 12 |
# File 'lib/ai_refactor/logger.rb', line 10 def info() puts end |
#success(message) ⇒ Object
28 29 30 |
# File 'lib/ai_refactor/logger.rb', line 28 def success() puts .colorize(color: :green, mode: :bold) end |
#verbose(message) ⇒ Object
19 20 21 22 |
# File 'lib/ai_refactor/logger.rb', line 19 def verbose() return unless @verbose puts "[#{}]".colorize(:light_blue) end |
#warn(message) ⇒ Object
24 25 26 |
# File 'lib/ai_refactor/logger.rb', line 24 def warn() puts .colorize(:yellow) end |