protected function logToFile($data, $type = '')
    {
        $this->logger->log(
            // Log as error if we get a GatewayErrorMessage
            is_subclass_of($type, GatewayErrorMessage::class) ? 'error' : 'info',
            // Log title
            sprintf('%s (%s)', $type, $this->payment->Gateway),
            // Log context (just output the data)
            Logging::prepareForLogging($data)
        );
    }