/** * Logs the report download request. * @param string $requestHeaders the HTTP request headers * @param integer $responseCode the HTTP response code * @param array $params the parameters that were sent, if any * @param Exception $exception the exception that will be thrown, if any */ private static function LogRequest($requestHeaders, $responseCode, $params = NULL, $exception = NULL) { $level = isset($exception) ? Logger::$ERROR : Logger::$INFO; $messageParts = array(); $messageParts[] = trim($requestHeaders); $messageParts[] = ''; // Blank line for readability. $messageParts[] = "Parameters:"; foreach ($params as $name => $value) { $messageParts[] = sprintf('%s: %s', $name, $value); } $messageParts[] = ''; // Blank line for readability. $messageParts[] = sprintf('Response Code: %s', $responseCode); if (isset($exception)) { $messageParts[] = sprintf('Error Message: %s', $exception->GetMessage()); } $messageParts[] = ''; // Blank line for readability. $message = implode("\n", $messageParts); Logger::Log(self::$LOG_NAME, $message, $level); }
public function addSkippedTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) { $this->skipped[] = $test->ToString(); $this->_Print('SKIPPED', $e->GetMessage(), self::COLOR_BLUE); }