Class: Capistrano::ASG::Rolling::Logger
- Inherits:
-
Object
- Object
- Capistrano::ASG::Rolling::Logger
- Defined in:
- lib/capistrano/asg/rolling/logger.rb
Overview
Logging support.
Instance Method Summary collapse
- #error(text) ⇒ Object
- #info(text) ⇒ Object
-
#initialize(verbose: false) ⇒ Logger
constructor
A new instance of Logger.
- #verbose(text) ⇒ Object
- #warning(text) ⇒ Object
Constructor Details
#initialize(verbose: false) ⇒ Logger
Returns a new instance of Logger.
8 9 10 |
# File 'lib/capistrano/asg/rolling/logger.rb', line 8 def initialize(verbose: false) @verbose = verbose end |
Instance Method Details
#error(text) ⇒ Object
20 21 22 |
# File 'lib/capistrano/asg/rolling/logger.rb', line 20 def error(text) $stderr.puts format_text(text, color: :red) # rubocop:disable Style/StderrPuts end |
#info(text) ⇒ Object
12 13 14 |
# File 'lib/capistrano/asg/rolling/logger.rb', line 12 def info(text) $stdout.puts format_text(text) end |
#verbose(text) ⇒ Object
24 25 26 |
# File 'lib/capistrano/asg/rolling/logger.rb', line 24 def verbose(text) info(text) if @verbose end |
#warning(text) ⇒ Object
16 17 18 |
# File 'lib/capistrano/asg/rolling/logger.rb', line 16 def warning(text) $stdout.puts format_text("WARNING: #{text}") end |