Always log stdout/stderr for SSH

This commit is contained in:
Mitchell Hashimoto 2013-02-01 10:56:00 -08:00
parent 6d002eb4c1
commit 3b75652256
1 changed files with 8 additions and 12 deletions

View File

@ -221,21 +221,17 @@ module VagrantPlugins
ch.exec(shell) do |ch2, _| ch.exec(shell) do |ch2, _|
# Setup the channel callbacks so we can get data and exit status # Setup the channel callbacks so we can get data and exit status
ch2.on_data do |ch3, data| ch2.on_data do |ch3, data|
if block_given? # Filter out the clear screen command
# Filter out the clear screen command data = remove_ansi_escape_codes(data)
data = remove_ansi_escape_codes(data) @logger.debug("stdout: #{data}")
@logger.debug("stdout: #{data}") yield :stdout, data if block_given?
yield :stdout, data
end
end end
ch2.on_extended_data do |ch3, type, data| ch2.on_extended_data do |ch3, type, data|
if block_given? # Filter out the clear screen command
# Filter out the clear screen command data = remove_ansi_escape_codes(data)
data = remove_ansi_escape_codes(data) @logger.debug("stderr: #{data}")
@logger.debug("stderr: #{data}") yield :stderr, data if block_given?
yield :stderr, data
end
end end
ch2.on_request("exit-status") do |ch3, data| ch2.on_request("exit-status") do |ch3, data|