You are here

interface LogMessageParserInterface in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Logger/LogMessageParserInterface.php \Drupal\Core\Logger\LogMessageParserInterface

Defines an interface for parsing log messages and their placeholders.

Hierarchy

Expanded class hierarchy of LogMessageParserInterface

All classes that implement LogMessageParserInterface

2 files declare their use of LogMessageParserInterface
DbLog.php in core/modules/dblog/src/Logger/DbLog.php
Contains \Drupal\dblog\Logger\DbLog.
SysLog.php in core/modules/syslog/src/Logger/SysLog.php
Contains \Drupal\syslog\Logger\SysLog.

File

core/lib/Drupal/Core/Logger/LogMessageParserInterface.php, line 13
Contains \Drupal\Core\Logger\LogMessageParserInterface.

Namespace

Drupal\Core\Logger
View source
interface LogMessageParserInterface {

  /**
   * Parses and transforms message and its placeholders to a common format.
   *
   * For a value to be considered as a placeholder should be in the following
   * formats:
   *   - PSR3 format:
   *     @see https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md#12-message
   *   - Drupal specific string placeholder format:
   *     @see \Drupal\Component\Utility\SafeMarkup::format()
   *
   * Values in PSR3 format will be transformed to SafeMarkup::format() format.
   *
   * @param string $message
   *   The message that contains the placeholders.
   *   If the message is in PSR3 style, it will be transformed to
   *   \Drupal\Component\Utility\SafeMarkup::format() style.
   * @param array $context
   *   An array that may or may not contain placeholder variables.
   *
   * @return array
   *   An array of the extracted message placeholders.
   */
  public function parseMessagePlaceholders(&$message, array &$context);

}

Members

Namesort descending Modifiers Type Description Overrides
LogMessageParserInterface::parseMessagePlaceholders public function Parses and transforms message and its placeholders to a common format. 1