Class: SSHKit::Formatter::LogFormat

Inherits:
Pretty
  • Object
show all
Defined in:
lib/capistrano/logger/sshkit/formatters/log_format.rb

Instance Method Summary collapse

Instance Method Details

#colorize(obj, _color, _mode = nil) ⇒ Object



8
9
10
# File 'lib/capistrano/logger/sshkit/formatters/log_format.rb', line 8

def colorize(obj, _color, _mode = nil)
  obj.to_s
end

#format_message(_verbosity, message, _uuid = nil) ⇒ Object



12
13
14
# File 'lib/capistrano/logger/sshkit/formatters/log_format.rb', line 12

def format_message(_verbosity, message, _uuid=nil)
  message
end

#log_command_exit(command) ⇒ Object



22
23
# File 'lib/capistrano/logger/sshkit/formatters/log_format.rb', line 22

def log_command_exit(command)
end

#log_command_start(command) ⇒ Object



16
17
18
19
20
# File 'lib/capistrano/logger/sshkit/formatters/log_format.rb', line 16

def log_command_start(command)
  host_prefix = command.host.user ? "as #{pretty_colorize(command.host.user, :blue)}@" : 'on '
  message = "Running #{pretty_colorize(command, :yellow, :bold)} #{host_prefix}#{pretty_colorize(command.host, :blue)}"
  write_message(command.verbosity, message, command.uuid)
end

#pretty_colorizeObject



7
# File 'lib/capistrano/logger/sshkit/formatters/log_format.rb', line 7

alias pretty_colorize colorize