8e6d207a843c7c0ae073920ea3da9b42192706fe
[yaffs-website] / web / core / lib / Drupal / Core / Logger / LogMessageParserInterface.php
1 <?php
2
3 namespace Drupal\Core\Logger;
4
5 /**
6  * Defines an interface for parsing log messages and their placeholders.
7  */
8 interface LogMessageParserInterface {
9
10   /**
11    * Parses and transforms message and its placeholders to a common format.
12    *
13    * For a value to be considered as a placeholder should be in the following
14    * formats:
15    *   - PSR3 format:
16    *     @see https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md#12-message
17    *   - Drupal specific string placeholder format:
18    *     @see \Drupal\Component\Render\FormattableMarkup
19    *
20    * Values in PSR3 format will be transformed to
21    * \Drupal\Component\Render\FormattableMarkup format.
22    *
23    * @param string $message
24    *   The message that contains the placeholders.
25    *   If the message is in PSR3 style, it will be transformed to
26    *   \Drupal\Component\Render\FormattableMarkup style.
27    * @param array $context
28    *   An array that may or may not contain placeholder variables.
29    *
30    * @return array
31    *   An array of the extracted message placeholders.
32    */
33   public function parseMessagePlaceholders(&$message, array &$context);
34
35 }