9

I'm trying to write a spec test with no info to stdout - not even STDERR.

Is it easily possible to instantiate a Logger with an IOObject that throws away the data passed to it in all circumstances, without monkeypatching the logger?

If so, is this common practice or should I simply use STDERR?

Regards,

1 Answer 1

18

You could create a logger for the null device:

logger = Logger.new(IO::NULL) 

or set a high logging severity threshold:

logger.level = Logger::ERROR 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.