Skip to content

Commit c48a0ba

Browse files
authored
Merge pull request #157 from simonschaufi/patch-1
Inject Logger configuration
2 parents 9dc314a + 5f005a8 commit c48a0ba

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/ProviderAndDumperAggregator.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,13 @@ protected function getProvidersFromConfiguration(Collection $providers) : array
247247
$reflection = new ReflectionClass($provider);
248248

249249
if ($provider === 'Geocoder\Provider\Chain\Chain') {
250-
return $reflection->newInstance($arguments);
250+
$chainProvider = $reflection->newInstance($arguments);
251+
252+
if (in_array(\Psr\Log\LoggerAwareTrait::class, class_uses($chainProvider)) && app(\Illuminate\Log\Logger::class) !== null) {
253+
$chainProvider->setLogger(app(\Illuminate\Log\Logger::class));
254+
}
255+
256+
return $chainProvider;
251257
}
252258

253259
return $reflection->newInstanceArgs($arguments);

0 commit comments

Comments
 (0)