protected function formatParams($message, $context)
    {
        if (!is_array($context)) {
            $context = array('context' => $context);
        }
        if ($message instanceof \Exception) {
            $context += array(
                'code' => $message->getCode(),
                'file' => $message->getFile(),
                'line' => $message->getLine(),
                'trace' => $message->getTraceAsString(),
            );
            $message = $message->getMessage();
        } elseif (is_array($message)) {
            $message = print_r($message, true);
        } else {
            $message = (string)$message;
        }
        return array('message' => $message, 'context' => $context);
    }