Refactors tests for logger.error