Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | declare(strict_types=1); |
| 3 | /** |
| 4 | * Pop PHP Framework (https://www.popphp.org/) |
| 5 | * |
| 6 | * @link https://github.com/popphp/popphp-framework |
| 7 | * @author Nick Sagona, III <dev@noladev.com> |
| 8 | * @copyright Copyright (c) 2009-2027 NOLA Interactive, LLC. |
| 9 | * @license https://www.popphp.org/license New BSD License |
| 10 | */ |
| 11 | |
| 12 | /** |
| 13 | * @namespace |
| 14 | */ |
| 15 | namespace Pop\Log\Formatter; |
| 16 | |
| 17 | /** |
| 18 | * Log formatter interface |
| 19 | * |
| 20 | * @category Pop |
| 21 | * @package Pop\Log |
| 22 | * @author Nick Sagona, III <dev@noladev.com> |
| 23 | * @copyright Copyright (c) 2009-2027 NOLA Interactive, LLC. |
| 24 | * @license https://www.popphp.org/license New BSD License |
| 25 | * @version 5.0.0 |
| 26 | */ |
| 27 | interface FormatterInterface |
| 28 | { |
| 29 | |
| 30 | /** |
| 31 | * Format a single log entry into a string |
| 32 | * |
| 33 | * Implementations that embed level/message/context values into a line-delimited or otherwise |
| 34 | * unescaped text format are responsible for sanitizing them via Pop\Log\Context::sanitize() — |
| 35 | * Writer\File does not pre-sanitize before calling this method, since not every format needs it |
| 36 | * (e.g. JSON's own encoding already escapes control characters safely within string values). |
| 37 | * |
| 38 | * @param string $level |
| 39 | * @param string $message |
| 40 | * @param array $context |
| 41 | * @return string |
| 42 | */ |
| 43 | public function format(string $level, string $message, array $context): string; |
| 44 | |
| 45 | } |