HookWatchdog.php in Drupal 7 to 8/9 Module Upgrader 8
File
src/Plugin/DMU/Converter/HookWatchdog.php
View source
<?php
namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Converter;
use Drupal\drupalmoduleupgrader\ConverterBase;
use Drupal\drupalmoduleupgrader\TargetInterface;
class HookWatchdog extends ConverterBase {
public function convert(TargetInterface $target) {
$this
->writeService($target, 'default_logger', [
'class' => 'Drupal\\' . $target
->id() . '\\Logger\\DefaultLogger',
'tags' => [
[
'name' => 'logger',
],
],
]);
$render = [
'#theme' => 'dmu_logger',
'#module' => $target
->id(),
];
$this
->writeClass($target, $this
->parse($render));
}
}
Classes
Name |
Description |
HookWatchdog |
Plugin annotation
@Converter(
id = "hook_watchdog",
description = @Translation("Converts hook_watchdog() to an implementation of \\Psr\\Log\\LoggerInterface."),
hook = "hook_watchdog"
) |