lib/silent_stream.rb
def silence_all(switch = true, temporary_level = Logger::ERROR, logger = nil)
      if !switch || silent_stream_no_silence
        yield
      else
        begin
          logger ||= silent_stream_logger
          old_logger_level = silent_stream_reset_logger_level(logger, temporary_level)
          # silence STDOUT (like puts)
          silence_stream(STDOUT) do
            yield
          end
        ensure
          silent_stream_reset_logger_level(logger, old_logger_level)
        end
      end
    end
# param switch is true or false
# By default it is true, when means we don't want logging.
# Switching it to false enables logging again.
# By default ERROR log level continues to be logged.
# The return value is the return value of the block,
#   so you can use it without changing code structure.
#
# This method is not thread-safe.
param switch is true or false
By default it is true, when means we don't want logging.
Switching it to false enables logging again.
By default ERROR log level continues to be logged.
The return value is the return value of the block,
so you can use it without changing code structure.

This method is not thread-safe.
param switch is true or false By default it is true when means we don ' t want logging . Switching it to false enables logging again . By default ERROR log level continues to be logged . The return value is the return value of the block so you can use it without changing code structure . This method is not thread - safe .
def silence_all(switch = true, temporary_level = Logger::ERROR, logger = nil)
      if !switch || silent_stream_no_silence
        yield
      else
        begin
          logger ||= silent_stream_logger
          old_logger_level = silent_stream_reset_logger_level(logger, temporary_level)
          silence_stream(STDOUT) do
            yield
          end
        ensure
          silent_stream_reset_logger_level(logger, old_logger_level)
        end
      end
    end
def silence_all ( switch = true , temporary_level = Logger :: ERROR , logger = nil ) if ! switch || silent_stream_no_silence yield else begin logger ||= silent_stream_logger old_logger_level = silent_stream_reset_logger_level ( logger , temporary_level ) silence_stream ( STDOUT ) do yield end ensure silent_stream_reset_logger_level ( logger , old_logger_level ) end end end
param switch is true or false
By default it is true, when means we don't want logging.
param switch is true or false By default it is true when means we don ' t want logging .
# silence STDOUT (like puts)
switch
temporary_level
logger