public function validate($logger)
    {
        $original = $logger;

        if (is_callable($logger)) {
            $logger = $logger($this->container);
        }

        // Check if logger is an instance of the PSR-3 logger interface
        if ($logger instanceof LoggerInterface) {
            return $original;
        }

        // A PSR-3 compatible log writer hasn't been configured so we don't know if it is
        // compatible with Phapi. Therefore we create an instance of the NullLogger instead
        return function ($app) {
            return new NullLogger();
        };
    }