LoggerTrait not compatible with D10

Created on 26 April 2024, 8 months ago
Updated 2 May 2024, 8 months ago

Problem/Motivation

When tying to use the LoggerTrait on a drupal 10 site I am met with the following. Fatal error: Declaration of weitzman\DrupalTestTraits\LoggerTrait::log($level, $message, array $context = []) must be compatible with Drupal\Core\Logger\RfcLoggerTrait::log($level, Stringable|string $message, array $context = []): void in /xxx/weitzman/drupal-test-traits/src/LoggerTrait.php on line 32

Steps to reproduce

To get this error I updated my drupal 9 site to drupal 10. It passed all the tests in the pipeline other than this one.

Proposed resolution

This function should be updated to the new drupal 10 format. It looks like there are patches for other similar loggers out there. They basically look like the following:
- public function log($level, $message, array $context = []) {
+ public function log($level, string|\Stringable $message, array $context = []): void {

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Closed: duplicate

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024