mirror of
https://github.com/10h30/wp-strava.git
synced 2026-07-11 18:56:18 +09:00
Add debug logging to remote_get
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user