| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * dmarc-srg - A php parser, viewer and summary report generator for incoming DMARC reports. |
| 5 | * Copyright (C) 2022 Aleksey Andreev (liuch) |
| 6 | * |
| 7 | * Available at: |
| 8 | * https://github.com/liuch/dmarc-srg |
| 9 | * |
| 10 | * This program is free software: you can redistribute it and/or modify it |
| 11 | * under the terms of the GNU General Public License as published by the Free |
| 12 | * Software Foundation, either version 3 of the License. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 17 | * more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License along with |
| 20 | * this program. If not, see <http://www.gnu.org/licenses/>. |
| 21 | * |
| 22 | * ========================= |
| 23 | * |
| 24 | * This file contains the interface LoggerInterface |
| 25 | * |
| 26 | * @category API |
| 27 | * @package DmarcSrg |
| 28 | * @author Aleksey Andreev (liuch) |
| 29 | * @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPLv3 |
| 30 | */ |
| 31 | |
| 32 | namespace Liuch\DmarcSrg\Log; |
| 33 | |
| 34 | /** |
| 35 | * Describes a logger instance |
| 36 | * The message MUST be a string or object implementing __toString(). |
| 37 | */ |
| 38 | interface LoggerInterface |
| 39 | { |
| 40 | /** |
| 41 | * System is unusable |
| 42 | * |
| 43 | * @param string $message |
| 44 | * @param array $context |
| 45 | * |
| 46 | * @return void |
| 47 | */ |
| 48 | public function emergency($message, array $context = []): void; |
| 49 | |
| 50 | /** |
| 51 | * Action must be taken immediately |
| 52 | * |
| 53 | * @param string $message |
| 54 | * @param array $context |
| 55 | * |
| 56 | * @return void |
| 57 | */ |
| 58 | public function alert($message, array $context = []): void; |
| 59 | |
| 60 | /** |
| 61 | * Critical conditions |
| 62 | * |
| 63 | * @param string $message |
| 64 | * @param array $context |
| 65 | * |
| 66 | * @return void |
| 67 | */ |
| 68 | public function critical($message, array $context = []): void; |
| 69 | |
| 70 | /** |
| 71 | * Runtime errors that do not require immediate action but should typically |
| 72 | * be logged and monitored |
| 73 | * |
| 74 | * @param string $message |
| 75 | * @param array $context |
| 76 | * |
| 77 | * @return void |
| 78 | */ |
| 79 | public function error($message, array $context = []): void; |
| 80 | |
| 81 | /** |
| 82 | * Exceptional occurrences that are not errors |
| 83 | * |
| 84 | * @param string $message |
| 85 | * @param array $context |
| 86 | * |
| 87 | * @return void |
| 88 | */ |
| 89 | public function warning($message, array $context = []): void; |
| 90 | |
| 91 | /** |
| 92 | * Normal but significant events |
| 93 | * |
| 94 | * @param string $message |
| 95 | * @param array $context |
| 96 | * |
| 97 | * @return void |
| 98 | */ |
| 99 | public function notice($message, array $context = []): void; |
| 100 | |
| 101 | /** |
| 102 | * Interesting events |
| 103 | * |
| 104 | * @param string $message |
| 105 | * @param array $context |
| 106 | * |
| 107 | * @return void |
| 108 | */ |
| 109 | public function info($message, array $context = []): void; |
| 110 | |
| 111 | /** |
| 112 | * Detailed debug information |
| 113 | * |
| 114 | * @param string $message |
| 115 | * @param array $context |
| 116 | * |
| 117 | * @return void |
| 118 | */ |
| 119 | public function debug($message, array $context = []): void; |
| 120 | |
| 121 | /** |
| 122 | * Logs with an arbitrary level |
| 123 | * |
| 124 | * @param mixed $level |
| 125 | * @param string $message |
| 126 | * @param array $context |
| 127 | * |
| 128 | * @return void |
| 129 | */ |
| 130 | public function log($level, $message, array $context = []): void; |
| 131 | } |