annotate core/lib/Drupal/Core/Logger/LogMessageParserInterface.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children 129ea1e6d783
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@0 15 * - PSR3 format:
Chris@0 16 * @see https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md#12-message
Chris@0 17 * - Drupal specific string placeholder format:
Chris@0 18 * @see \Drupal\Component\Utility\SafeMarkup::format()
Chris@0 19 *
Chris@0 20 * Values in PSR3 format will be transformed to SafeMarkup::format() 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@0 25 * \Drupal\Component\Utility\SafeMarkup::format() 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@0 31 */
Chris@0 32 public function parseMessagePlaceholders(&$message, array &$context);
Chris@0 33
Chris@0 34 }