Skip to content

Commit

Permalink
Merge pull request #157 from simonschaufi/patch-1
Browse files Browse the repository at this point in the history
Inject Logger configuration
  • Loading branch information
mikebronner authored Oct 2, 2019
2 parents 9dc314a + 5f005a8 commit c48a0ba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ProviderAndDumperAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,13 @@ protected function getProvidersFromConfiguration(Collection $providers) : array
$reflection = new ReflectionClass($provider);

if ($provider === 'Geocoder\Provider\Chain\Chain') {
return $reflection->newInstance($arguments);
$chainProvider = $reflection->newInstance($arguments);

if (in_array(\Psr\Log\LoggerAwareTrait::class, class_uses($chainProvider)) && app(\Illuminate\Log\Logger::class) !== null) {
$chainProvider->setLogger(app(\Illuminate\Log\Logger::class));
}

return $chainProvider;
}

return $reflection->newInstanceArgs($arguments);
Expand Down

0 comments on commit c48a0ba

Please sign in to comment.