Laurie Young
Laurie Young

Reputation: 138494

How do I silence the following RightAWS messages when running tests

I'm using the RighAWS gem, and mocking at the http level so that the RightAWS code is being executed 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 .

Even though all the tests pass, when I do have errors its harder to scan them because of this output. is there a nice way to silence it?

Upvotes: 3

Views: 676

Answers (1)

bhups
bhups

Reputation: 14895

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

Upvotes: 6

Related Questions