How to exclude Logger from PIT coverage.

299 views
Skip to first unread message

Devanand Chatrathi

unread,
Jun 21, 2015, 1:56:58 PM6/21/15
to pitu...@googlegroups.com
How to exclude Logger from PIT coverage. Is it a good practice to exclude logger or we should cover that also.

Henry Coles

unread,
Jun 21, 2015, 3:32:19 PM6/21/15
to pitu...@googlegroups.com
On 21 June 2015 at 18:56, Devanand Chatrathi <devanand....@gmail.com> wrote:
How to exclude Logger from PIT coverage. Is it a good practice to exclude logger or we should cover that also.

By default PIT excludes calls to classes in the following root packages (and their children) from mutation
  • java.util.logging
  • org.apache.log4j
  • org.slf4j
  • org.apache.commons.logging
 If you using a logger not in one of these packages you can exclude it using the avoidCallsTo configuration parameter.

Henry

Marcin Zajączkowski

unread,
Jun 21, 2015, 3:33:22 PM6/21/15
to pitu...@googlegroups.com
On 2015-06-21 19:56, Devanand Chatrathi wrote:
> How to exclude Logger from PIT coverage. Is it a good practice to exclude
> logger or we should cover that also.

What logger do you use? Have you checked that they are reported related
survived mutations?

AFAIK commonly used loggers are ignored by PIT.

Marcin

Devanand Chatrathi

unread,
Jun 21, 2015, 3:37:42 PM6/21/15
to pitu...@googlegroups.com
I am using Log4J logger but somehow avoidCallsTo is not being recognized. can you see any potential problems.

henry

unread,
Jun 22, 2015, 5:24:12 AM6/22/15
to pitu...@googlegroups.com, devanand....@gmail.com


On Sunday, 21 June 2015 20:37:42 UTC+1, Devanand Chatrathi wrote:
I am using Log4J logger but somehow avoidCallsTo is not being recognized. can you see any potential problems.


If you're using the Log4J logger directly then everything should just work. The usual problem is that the logger has been wrapped up in a customer logger in a different package. If you've done this you'll need to add the custom logger to the avoidCallsTo list.

Can you post your config and an example of the code you expect not be mutated?

Thanks

Henry
Reply all
Reply to author
Forward
0 new messages