How to disable the following RightAWS messages when running tests

I use the RighAWS stone and poke fun at the http level so that the RightAWS code runs as part of my tests.

When this happens, I get the following output

....New RightAws::S3Interface using per_request-connection mode Opening new HTTP connection to s3.amazonaws.com:80 .New RightAws::S3Interface using per_request-connection mode .

Despite the fact that all tests pass when I get errors, it’s more difficult to scan them because of this output. is there any good way to silence him?

+3
source share
1 answer

you can use null device for logging:

s3 = RightAws::S3Interface.new(access_key, secret_key, {:port => 80, :protocol => 'http', :logger => Logger.new('/dev/null')})  //on unix system
s3 = RightAws::S3Interface.new(access_key, secret_key, {:port => 80, :protocol => 'http', :logger => Logger.new('NUL')})  //on windows
+6
source

Source: https://habr.com/ru/post/1723995/


All Articles