Logs are being printed twice when using logger in pytest. I am using a custom plugging to collect all the logs from each test and log them in teardown. I am running the test