annotate core/lib/Drupal/Core/Logger/LogMessageParserInterface.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 129ea1e6d783
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\Core\Logger;
Chris@0 4
Chris@0 5 /**
Chris@0 6 * Defines an interface for parsing log messages and their placeholders.
Chris@0 7 */
Chris@0 8 interface LogMessageParserInterface {
Chris@0 9
Chris@0 10 /**
Chris@0 11 * Parses and transforms message and its placeholders to a common format.
Chris@0 12 *
Chris@0 13 * For a value to be considered as a placeholder should be in the following
Chris@0 14 * formats:
Chris@17 15 * - @link https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md#12-message The PSR3 format @endlink
Chris@17 16 * - The Drupal specific string placeholder format, described in
Chris@17 17 * \Drupal\Component\Render\FormattableMarkup
Chris@0 18 *
Chris@17 19 * Values in PSR3 format will be transformed to
Chris@17 20 * \Drupal\Component\Render\FormattableMarkup format.
Chris@0 21 *
Chris@0 22 * @param string $message
Chris@0 23 * The message that contains the placeholders.
Chris@0 24 * If the message is in PSR3 style, it will be transformed to
Chris@17 25 * \Drupal\Component\Render\FormattableMarkup style.
Chris@0 26 * @param array $context
Chris@0 27 * An array that may or may not contain placeholder variables.
Chris@0 28 *
Chris@0 29 * @return array
Chris@0 30 * An array of the extracted message placeholders.
Chris@17 31 *
Chris@17 32 * @see \Drupal\Component\Render\FormattableMarkup
Chris@0 33 */
Chris@0 34 public function parseMessagePlaceholders(&$message, array &$context);
Chris@0 35
Chris@0 36 }