1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Verbose command execution log should be optional. Set :verbose_command_log to true when you need it. Refs #178.

This commit is contained in:
Kenn Ejima 2012-03-10 10:43:18 -08:00
parent 7de5eb0367
commit e9ba06f354
3 changed files with 7 additions and 3 deletions

View file

@ -219,7 +219,7 @@ module Capistrano
command_line = [environment, shell, cmd].compact.join(" ")
ch[:command] = command_line
logger.trace command_line, ch[:server] if logger
logger.trace command_line, ch[:server] if logger && options[:verbose_command_log]
ch.exec(command_line)
ch.send_data(options[:data]) if options[:data]

View file

@ -175,7 +175,11 @@ module Capistrano
execute_on_servers(options) do |servers|
targets = servers.map { |s| sessions[s] }
Command.process(tree, targets, options.merge(:logger => logger))
Command.process(tree, targets, options.merge(
:logger => logger,
:verbose_command_log => fetch(:verbose_command_log, false)
)
)
end
end

View file

@ -16,7 +16,7 @@ class ConfigurationTest < Test::Unit::TestCase
process_args = Proc.new do |tree, session, opts|
tree.fallback.command == "echo 'hello world'" &&
session == [:session] &&
opts == { :logger => @config.logger }
opts == { :logger => @config.logger, :verbose_command_log => false }
end
Capistrano::Command.expects(:process).with(&process_args)