Enable logging for ObjectRetriever
This commit is contained in:
@@ -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));
|
||||||
|
|||||||
Reference in New Issue
Block a user