Skip to content

Commit 3137724

Browse files
authored
Merge pull request #480 from php-enqueue/fix-call-debug-on-null
Fix call debug method on null
2 parents 5df95c6 + 3456e77 commit 3137724

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/enqueue/Consumption/QueueConsumer.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,13 @@ public function consume(ExtensionInterface $runtimeExtension = null)
178178
$context = new Context($this->psrContext);
179179
$this->extension->onStart($context);
180180

181-
$this->logger = $context->getLogger() ?: new NullLogger();
181+
if ($context->getLogger()) {
182+
$this->logger = $context->getLogger();
183+
} else {
184+
$this->logger = new NullLogger();
185+
$context->setLogger($this->logger);
186+
}
187+
182188
$this->logger->info('Start consuming');
183189

184190
if ($this->psrContext instanceof AmqpContext) {

0 commit comments

Comments
 (0)