| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
* This file is part of the Monolog package. |
| 5 |
* |
| 6 |
* (c) Jordi Boggiano <j.boggiano@seld.be> |
| 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 |
/** |
| 13 |
* Interface that all Monolog Handlers must implement |
| 14 |
* |
| 15 |
* @author Jordi Boggiano <j.boggiano@seld.be> |
| 16 |
*/ |
| 17 |
interface Monolog_Handler_HandlerInterface |
| 18 |
{ |
| 19 |
/** |
| 20 |
* Checks whether the given record will be handled by this handler. |
| 21 |
* |
| 22 |
* This is mostly done for performance reasons, to avoid calling processors for nothing. |
| 23 |
* |
| 24 |
* Handlers should still check the record levels within handle(), returning false in isHandling() |
| 25 |
* is no guarantee that handle() will not be called, and isHandling() might not be called |
| 26 |
* for a given record. |
| 27 |
* |
| 28 |
* @param array $record |
| 29 |
* |
| 30 |
* @return Boolean |
| 31 |
*/ |
| 32 |
public function isHandling(array $record); |
| 33 |
|
| 34 |
/** |
| 35 |
* Handles a record. |
| 36 |
* |
| 37 |
* All records may be passed to this method, and the handler should discard |
| 38 |
* those that it does not want to handle. |
| 39 |
* |
| 40 |
* The return value of this function controls the bubbling process of the handler stack. |
| 41 |
* Unless the bubbling is interrupted (by returning true), the Logger class will keep on |
| 42 |
* calling further handlers in the stack with a given log record. |
| 43 |
* |
| 44 |
* @param array $record The record to handle |
| 45 |
* |
| 46 |
* @return Boolean true means that this handler handled the record, and that bubbling is not permitted. |
| 47 |
* false means the record was either not processed or that this handler allows bubbling. |
| 48 |
*/ |
| 49 |
public function handle(array $record); |
| 50 |
|
| 51 |
/** |
| 52 |
* Handles a set of records at once. |
| 53 |
* |
| 54 |
* @param array $records The records to handle (an array of record arrays) |
| 55 |
*/ |
| 56 |
public function handleBatch(array $records); |
| 57 |
|
| 58 |
/** |
| 59 |
* Adds a processor in the stack. |
| 60 |
* |
| 61 |
* @param callable $callback |
| 62 |
* |
| 63 |
* @return self |
| 64 |
*/ |
| 65 |
public function pushProcessor($callback); |
| 66 |
|
| 67 |
/** |
| 68 |
* Removes the processor on top of the stack and returns it. |
| 69 |
* |
| 70 |
* @return callable |
| 71 |
*/ |
| 72 |
public function popProcessor(); |
| 73 |
|
| 74 |
/** |
| 75 |
* Sets the formatter. |
| 76 |
* |
| 77 |
* @param Monolog_Formatter_FormatterInterface $formatter |
| 78 |
* |
| 79 |
* @return self |
| 80 |
*/ |
| 81 |
public function setFormatter(Monolog_Formatter_FormatterInterface $formatter); |
| 82 |
|
| 83 |
/** |
| 84 |
* Gets the formatter. |
| 85 |
* |
| 86 |
* @return Monolog_Formatter_FormatterInterface |
| 87 |
*/ |
| 88 |
public function getFormatter(); |
| 89 |
} |
| 90 |
|