Skip to content
Snippets Groups Projects
Commit c4706d78 authored by Jürgen Haas's avatar Jürgen Haas
Browse files

Issue #3465628 by jurgenhaas: Replace logger in drush framework commands

parent cc661d4e
Branches
Tags 2.5.5
No related merge requests found
Pipeline #242571 passed with warnings
......@@ -21,6 +21,16 @@ class FrameworkCommands extends DrushCommands {
*/
protected StateInterface $state;
/**
* The Drupal logger.
*
* Important: we can not use $logger here, since Drush 13 decided to use that
* for its own purposes and gave it another type.
*
* @var \Drupal\Core\Logger\LoggerChannelInterface
*/
protected LoggerChannelInterface $drupalLogger;
/**
* Constructs the FrameworkCommands.
*
......@@ -32,7 +42,7 @@ class FrameworkCommands extends DrushCommands {
public function __construct(StateInterface $state, LoggerChannelInterface $logger) {
parent::__construct();
$this->state = $state;
$this->logger = $logger;
$this->drupalLogger = $logger;
}
/**
......@@ -106,10 +116,10 @@ class FrameworkCommands extends DrushCommands {
}
if ($newState !== $state || $newState === 'empty') {
if ($newState === 'ok') {
$this->logger->info('Slide change on device %name restored.', ['%name' => $device->label()]);
$this->drupalLogger->info('Slide change on device %name restored.', ['%name' => $device->label()]);
}
else {
$this->logger->critical('Slide change on device %name broken.', ['%name' => $device->label()]);
$this->drupalLogger->critical('Slide change on device %name broken.', ['%name' => $device->label()]);
}
$this->state->set('digital-signage-device:' . $device->id() . ':status:slide', $newState);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment