loggerFactory) { $this->loggerFactory = \Drupal::service('logger.factory'); } return $this->loggerFactory->get($channel); } /** * Injects the logger channel factory. * * @param \Drupal\Core\Logger\LoggerChannelFactoryInterface $logger_factory * The logger channel factory service. * * @return $this */ public function setLoggerFactory(LoggerChannelFactoryInterface $logger_factory) { $this->loggerFactory = $logger_factory; return $this; } }