Skip to content

Commit

Permalink
More verbose debug logging of outgoing requests
Browse files Browse the repository at this point in the history
  • Loading branch information
chibimagic committed Mar 26, 2015
1 parent f72ff16 commit e901c24
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion WebDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public static function Curl($http_type, $full_url, $payload = null, $escape_payl
$curl = curl_init($full_url);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $http_type);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLINFO_HEADER_OUT, TRUE);
curl_setopt($curl, CURLOPT_HEADER, TRUE);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, WebDriver::$CurlConnectTimeoutSec);
curl_setopt($curl, CURLOPT_TIMEOUT, WebDriver::$CurlTimeoutSec);
Expand All @@ -104,8 +105,11 @@ public static function Curl($http_type, $full_url, $payload = null, $escape_payl
$cookie_string = http_build_query($cookies, '', '; ');
curl_setopt($curl, CURLOPT_COOKIE, $cookie_string);
}
WebDriver::LogDebug($http_type, $full_url, $payload);
$full_response = curl_exec($curl);
$request_header = curl_getinfo($curl, CURLINFO_HEADER_OUT);
WebDriver::LogDebug($request_header);
WebDriver::LogDebug($payload);
WebDriver::LogDebug("-");
WebDriver::LogDebug($full_response);
WebDriver::LogDebug("=====");
$error = curl_error($curl);
Expand Down

0 comments on commit e901c24

Please sign in to comment.