|
0
|
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 |
namespace Monolog\Handler; |
|
|
13 |
|
|
|
14 |
use Monolog\Formatter\FormatterInterface; |
|
|
15 |
|
|
|
16 |
/** |
|
|
17 |
* Interface that all Monolog Handlers must implement |
|
|
18 |
* |
|
|
19 |
* @author Jordi Boggiano <j.boggiano@seld.be> |
|
|
20 |
*/ |
|
|
21 |
interface HandlerInterface |
|
|
22 |
{ |
|
|
23 |
/** |
|
|
24 |
* Checks whether the given record will be handled by this handler. |
|
|
25 |
* |
|
|
26 |
* This is mostly done for performance reasons, to avoid calling processors for nothing. |
|
|
27 |
* |
|
|
28 |
* @return Boolean |
|
|
29 |
*/ |
|
|
30 |
function isHandling(array $record); |
|
|
31 |
|
|
|
32 |
/** |
|
|
33 |
* Handles a record. |
|
|
34 |
* |
|
|
35 |
* The return value of this function controls the bubbling process of the handler stack. |
|
|
36 |
* |
|
|
37 |
* @param array $record The record to handle |
|
|
38 |
* @return Boolean True means that this handler handled the record, and that bubbling is not permitted. |
|
|
39 |
* False means the record was either not processed or that this handler allows bubbling. |
|
|
40 |
*/ |
|
|
41 |
function handle(array $record); |
|
|
42 |
|
|
|
43 |
/** |
|
|
44 |
* Handles a set of records at once. |
|
|
45 |
* |
|
|
46 |
* @param array $records The records to handle (an array of record arrays) |
|
|
47 |
*/ |
|
|
48 |
function handleBatch(array $records); |
|
|
49 |
|
|
|
50 |
/** |
|
|
51 |
* Adds a processor in the stack. |
|
|
52 |
* |
|
|
53 |
* @param callable $callback |
|
|
54 |
*/ |
|
|
55 |
function pushProcessor($callback); |
|
|
56 |
|
|
|
57 |
/** |
|
|
58 |
* Removes the processor on top of the stack and returns it. |
|
|
59 |
* |
|
|
60 |
* @return callable |
|
|
61 |
*/ |
|
|
62 |
function popProcessor(); |
|
|
63 |
|
|
|
64 |
/** |
|
|
65 |
* Sets the formatter. |
|
|
66 |
* |
|
|
67 |
* @param FormatterInterface $formatter |
|
|
68 |
*/ |
|
|
69 |
function setFormatter(FormatterInterface $formatter); |
|
|
70 |
|
|
|
71 |
/** |
|
|
72 |
* Gets the formatter. |
|
|
73 |
* |
|
|
74 |
* @return FormatterInterface |
|
|
75 |
*/ |
|
|
76 |
function getFormatter(); |
|
|
77 |
} |