From: Joe Van Dyk Date: 2005-11-24T04:40:37+09:00 Subject: Re: Buncha logging stuff showing up in unit tests On 11/23/05, Eric Hodel wrote: > On Nov 23, 2005, at 11:32 AM, Joe Van Dyk wrote: > > > I'm using Ruby's standard Logger to log a bunch of debug, info, and > > errors. > > > > But when I run the unit tests for the classes that use the Logger, all > > the logs are showing up in the test output. > > > > Any good solutions for solving this? > > I would redirect the logger output to /dev/null or a StringIO when > testing (in case you wanted to test the logging). How do the classes know whether or not they are being tested? Eventually, I will be using a custom Logging method that sends all the logs to some network log daemon thingy so that all the logs are kept on one machine.