Skip to content

Commit ac13cbf

Browse files
committed
Cast message to string before passing it to strtr
1 parent 00b6c6b commit ac13cbf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

templates/Service/_logger/logger.twig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ final class {{ class }} implements LoggerInterface {
3434
* {@inheritdoc}
3535
*/
3636
public function log($level, string|\Stringable $message, array $context = []): void {
37+
// Cast message to string
38+
$message = (string) $message;
3739
// Convert PSR3-style messages to \Drupal\Component\Render\FormattableMarkup
3840
// style, so they can be translated too.
3941
$placeholders = $this->parser->parseMessagePlaceholders($message, $context);

0 commit comments

Comments
 (0)