Skip to content

Commit

Permalink
Merge pull request #184 from znerol-forks/fix/4.x/logger-strict-types
Browse files Browse the repository at this point in the history
Logger: Cast message to string before passing it to strtr
  • Loading branch information
Chi-teck authored Oct 15, 2024
2 parents 00b6c6b + adc6f6b commit 27b41bb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions templates/Service/_logger/logger.twig
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ final class {{ class }} implements LoggerInterface {
* {@inheritdoc}
*/
public function log($level, string|\Stringable $message, array $context = []): void {
$message = (string) $message;
// Convert PSR3-style messages to \Drupal\Component\Render\FormattableMarkup
// style, so they can be translated too.
$placeholders = $this->parser->parseMessagePlaceholders($message, $context);
Expand Down

0 comments on commit 27b41bb

Please sign in to comment.