From 3b3ab48120b63acc8e21b01c94e5c6a1410143a6 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 11 Jan 2023 17:01:19 +0100 Subject: [PATCH] Set a different verbosity level for the duration of the yield --- lib/tasks/mrsk/setup.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/tasks/mrsk/setup.rb b/lib/tasks/mrsk/setup.rb index 9502fd45..d6013c5c 100644 --- a/lib/tasks/mrsk/setup.rb +++ b/lib/tasks/mrsk/setup.rb @@ -14,3 +14,12 @@ else # MRSK is missing config/deploy.yml – run 'rake mrsk:init' MRSK_CONFIG = Mrsk::Configuration.new({}, validate: false) end + +# Set a different verbosity level for the duration of the yield +def verbosity(level) + old_level = SSHKit.config.output_verbosity + SSHKit.config.output_verbosity = level + yield +ensure + SSHKit.config.output_verbosity = old_level +end