Add debug logging to remote_get

This commit is contained in:
Justin Foell
2022-04-29 14:18:30 -05:00
parent 01f2cfa90e
commit ed4df3cee2
+16
View File
@@ -151,6 +151,22 @@ class WPStrava_API {
}
$response = wp_remote_get( $url, $get_args );
if ( WPSTRAVA_DEBUG ) {
// phpcs:disable WordPress.PHP.DevelopmentFunctions -- Debug output.
error_log(
print_r(
array(
'url' => $url,
'args' => $get_args,
'response' => $response,
),
true
)
);
// phpcs:enable
}
if ( is_wp_error( $response ) ) {
throw WPStrava_Exception::from_wp_error( $response );
}