Skip to content

Commit 27b41bb

Browse files
authored
Merge pull request #184 from znerol-forks/fix/4.x/logger-strict-types
Logger: Cast message to string before passing it to strtr
2 parents 00b6c6b + adc6f6b commit 27b41bb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

templates/Service/_logger/logger.twig

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

0 commit comments

Comments
 (0)