Class: Capistrano::ASG::Rolling::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/capistrano/asg/rolling/logger.rb

Overview

Logging support.

Instance Method Summary collapse

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