protected function findTapLog()
    {
        // Look for the beginning of the TAP output
        do {
            $header = $this->nextLine();
        } while ($header !== false && substr($header, 0, 12) !== 'TAP version ');

        //
        if ($header === false) {
            throw new Exception('No TAP log found, please check the configuration.');
        } elseif ($header !== 'TAP version 13') {
            throw new Exception(Lang::get('tap_version'));
        }

        return $header;
    }