Enable logging for ObjectRetriever

This commit is contained in:
2026-06-01 16:57:48 +00:00
parent abb464b480
commit 8eeea99a66

View File

@@ -6,7 +6,8 @@
namespace CloudObjects\SDK\Laravel; namespace CloudObjects\SDK\Laravel;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider,
Illuminate\Support\Arr;
use CloudObjects\SDK\ObjectRetriever; use CloudObjects\SDK\ObjectRetriever;
use CloudObjects\SDK\WebAPI\APIClientFactory; use CloudObjects\SDK\WebAPI\APIClientFactory;
@@ -20,7 +21,13 @@ class CloudObjectsServiceProvider extends ServiceProvider {
public function register() { public function register() {
$this->app->bind(ObjectRetriever::class, function() { $this->app->bind(ObjectRetriever::class, function() {
return new ObjectRetriever($this->app['config']->get('cloudobjects.core')); $retriever = new ObjectRetriever(
Arr::only($this->app['config']->get('cloudobjects.core'),
[ 'auth_ns', 'auth_secret' ]
)
);
$retriever->setLogger($this->app['log']);
return $retriever;
}); });
$this->app->bind(APIClientFactory::class, function() { $this->app->bind(APIClientFactory::class, function() {
return new APIClientFactory(app(ObjectRetriever::class)); return new APIClientFactory(app(ObjectRetriever::class));