public function onMessage(MessageEvent $e)
    {
        $formatter = $this->getFormatter();
        $adapterKey = $e->getAdapter()->getKey();
        $level = $e->getLevel();
        $message = $e->getMessage();

        $match = '/\r\n?/';

        //check if the message has weird formatting before trying to format it (currently a hack to avoid segmentation faults)
        if (!preg_match($match, $message)) {
            $msg = sprintf(
                "%s (%s): %s",
                $formatter->formatBlock($adapterKey, 'info'),
                $formatter->formatBlock($level, 'comment'),
                $message
            );
        } else {
            $msg = sprintf(
                "%s (%s): %s",
                $adapterKey,
                $level,
                preg_replace('/\r\n?/', '', $message)
            );
        }

        $this->getOutput()->writeln($msg);
    }