Skip to content

Commit

Permalink
replace key message by class in context log
Browse files Browse the repository at this point in the history
  • Loading branch information
smaine milianni committed Nov 3, 2023
1 parent 28e97b8 commit 669c011
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Listener/Symfony/MessengerListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public function onMessageReceived(WorkerMessageReceivedEvent $event): void
if (is_object($message) && !in_array($class = get_class($message), $this->config->getMessageToAssert(), true)) {
$this->logger->log(
$this->logLevel,
'Untracked {message} has been detected, add it in your configuration to ensure ZDD compliance.',
sprintf('Untracked message "%s" has been detected, add it in your configuration to ensure ZDD compliance.', $class),
[
'message' => $class,
'class' => $class,
],
);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Listener/Symfony/MessengerListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ public function testOnMessageReceivedLogMessageWhenMessageIsNotTracked(object $m
$messageListener->onMessageReceived($event);

self::assertTrue($spyLogger->hasRecord(
'Untracked {message} has been detected, add it in your configuration to ensure ZDD compliance.',
sprintf('Untracked message "%s" has been detected, add it in your configuration to ensure ZDD compliance.', $class),
$logLevel,
[
'message' => $class,
'class' => $class,
]
));
}
Expand Down

0 comments on commit 669c011

Please sign in to comment.