Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove approval's debug info from build logs

When I am running approval tests some debug output from approval test gets to my logs. It looks like 2/15/2016 1:58:48 PM ~000002ms Variable: approvalFrame = '' 2/15/2016 1:58:48 PM ~000025ms Variable: approvalFrame = '' 2/15/2016 1:58:48 PM ~000003ms Variable: approvalFrame = '' 2/15/2016 1:58:48 PM ~000002ms Variable: approvalFrame = '......

Is there any way to hide it from logs?

Thanks.

like image 557
the_joric Avatar asked Feb 15 '16 12:02

the_joric


1 Answers

ApprovalTests uses the SimpleLogger for logging. If you set it to null it won't log to your files. If you want to use the SimpleLogger afterwards, reset it.

 ApprovalUtilities.SimpleLogger.Logger.Writer = NullWriter.Instance;

To reset

Logger.Writer = new MultiWriter(new ConsoleWriter(),new DebugerWriter());

There are lot's of other writers of course and you can make your own composites or very own versions as well.

Happy Testing!

like image 191
llewellyn falco Avatar answered Nov 19 '22 01:11

llewellyn falco