Add support for injecting a logger.