From 202890de0e06de98fe0e232f5a3c83cf2eea123d Mon Sep 17 00:00:00 2001 From: Hector Mendoza Jacobo Date: Fri, 18 Oct 2024 22:03:03 +0000 Subject: [PATCH] Add support for logger in --- src/ApplicationDefaultCredentials.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ApplicationDefaultCredentials.php b/src/ApplicationDefaultCredentials.php index 8f0af6660..5474effc5 100644 --- a/src/ApplicationDefaultCredentials.php +++ b/src/ApplicationDefaultCredentials.php @@ -150,7 +150,8 @@ public static function getMiddleware( * user-defined scopes exist, expressed either as an Array or as a * space-delimited string. * @param string $universeDomain Specifies a universe domain to use for the - * calling client library + * calling client library. + * @param null|false|LoggerInterface $logger A PSR3 compliant LoggerInterface. * * @return FetchAuthTokenInterface * @throws DomainException if no implementation can be obtained. @@ -162,7 +163,8 @@ public static function getCredentials( CacheItemPoolInterface $cache = null, $quotaProject = null, $defaultScope = null, - string $universeDomain = null + string $universeDomain = null, + null|false|LoggerInterface $logger = null, ) { $creds = null; $jsonKey = CredentialsLoader::fromEnv() @@ -175,7 +177,7 @@ public static function getCredentials( HttpClientCache::setHttpClient($client); } - $httpHandler = HttpHandlerFactory::build($client); + $httpHandler = HttpHandlerFactory::build($client, $logger); } if (is_null($quotaProject)) {