You are here

protected function FormBase::logger in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Form/FormBase.php \Drupal\Core\Form\FormBase::logger()

Gets the logger for a specific channel.

Parameters

string $channel: The name of the channel.

Return value

\Psr\Log\LoggerInterface The logger for this channel.

3 calls to FormBase::logger()
BlockContentForm::save in core/modules/block_content/src/BlockContentForm.php
Form submission handler for the 'save' action.
BlockContentTypeForm::save in core/modules/block_content/src/BlockContentTypeForm.php
Form submission handler for the 'save' action.
CommentForm::save in core/modules/comment/src/CommentForm.php
Form submission handler for the 'save' action.

File

core/lib/Drupal/Core/Form/FormBase.php, line 207
Contains \Drupal\Core\Form\FormBase.

Class

FormBase
Provides a base class for forms.

Namespace

Drupal\Core\Form

Code

protected function logger($channel) {
  if (!$this->loggerFactory) {
    $this->loggerFactory = $this
      ->container()
      ->get('logger.factory');
  }
  return $this->loggerFactory
    ->get($channel);
}