| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
* This file is part of Mustache.php. |
| 5 |
* |
| 6 |
* (c) 2010-2026 Justin Hileman |
| 7 |
* |
| 8 |
* For the full copyright and license information, please view the LICENSE |
| 9 |
* file that was distributed with this source code. |
| 10 |
*/ |
| 11 |
|
| 12 |
namespace Mustache; |
| 13 |
|
| 14 |
interface Logger |
| 15 |
{ |
| 16 |
/** |
| 17 |
* Psr\Log compatible log levels. |
| 18 |
*/ |
| 19 |
const EMERGENCY = 'emergency'; |
| 20 |
const ALERT = 'alert'; |
| 21 |
const CRITICAL = 'critical'; |
| 22 |
const ERROR = 'error'; |
| 23 |
const WARNING = 'warning'; |
| 24 |
const NOTICE = 'notice'; |
| 25 |
const INFO = 'info'; |
| 26 |
const DEBUG = 'debug'; |
| 27 |
|
| 28 |
/** |
| 29 |
* System is unusable. |
| 30 |
* |
| 31 |
* @param string $message |
| 32 |
*/ |
| 33 |
public function emergency($message, array $context = []); |
| 34 |
|
| 35 |
/** |
| 36 |
* Action must be taken immediately. |
| 37 |
* |
| 38 |
* Example: Entire website down, database unavailable, etc. This should |
| 39 |
* trigger the SMS alerts and wake you up. |
| 40 |
* |
| 41 |
* @param string $message |
| 42 |
*/ |
| 43 |
public function alert($message, array $context = []); |
| 44 |
|
| 45 |
/** |
| 46 |
* Critical conditions. |
| 47 |
* |
| 48 |
* Example: Application component unavailable, unexpected exception. |
| 49 |
* |
| 50 |
* @param string $message |
| 51 |
*/ |
| 52 |
public function critical($message, array $context = []); |
| 53 |
|
| 54 |
/** |
| 55 |
* Runtime errors that do not require immediate action but should typically |
| 56 |
* be logged and monitored. |
| 57 |
* |
| 58 |
* @param string $message |
| 59 |
*/ |
| 60 |
public function error($message, array $context = []); |
| 61 |
|
| 62 |
/** |
| 63 |
* Exceptional occurrences that are not errors. |
| 64 |
* |
| 65 |
* Example: Use of deprecated APIs, poor use of an API, undesirable things |
| 66 |
* that are not necessarily wrong. |
| 67 |
* |
| 68 |
* @param string $message |
| 69 |
*/ |
| 70 |
public function warning($message, array $context = []); |
| 71 |
|
| 72 |
/** |
| 73 |
* Normal but significant events. |
| 74 |
* |
| 75 |
* @param string $message |
| 76 |
*/ |
| 77 |
public function notice($message, array $context = []); |
| 78 |
|
| 79 |
/** |
| 80 |
* Interesting events. |
| 81 |
* |
| 82 |
* Example: User logs in, SQL logs. |
| 83 |
* |
| 84 |
* @param string $message |
| 85 |
*/ |
| 86 |
public function info($message, array $context = []); |
| 87 |
|
| 88 |
/** |
| 89 |
* Detailed debug information. |
| 90 |
* |
| 91 |
* @param string $message |
| 92 |
*/ |
| 93 |
public function debug($message, array $context = []); |
| 94 |
|
| 95 |
/** |
| 96 |
* Logs with an arbitrary level. |
| 97 |
* |
| 98 |
* @param mixed $level |
| 99 |
* @param string $message |
| 100 |
*/ |
| 101 |
public function log($level, $message, array $context = []); |
| 102 |
} |
| 103 |
|