1 | <?php |
||
25 | trait HandlerAwareTrait |
||
26 | { |
||
27 | use LogLevelTrait; |
||
28 | use VerifyCallableTrait; |
||
29 | |||
30 | /** |
||
31 | * queue for the handlers |
||
32 | * |
||
33 | * @var UniquePriorityQueue[][] |
||
34 | */ |
||
35 | protected $handlers = []; |
||
36 | |||
37 | /** |
||
38 | * @var array |
||
39 | */ |
||
40 | protected $handlerCache = []; |
||
41 | |||
42 | /** |
||
43 | * {@inheritDoc} |
||
44 | */ |
||
45 | public function addHandler( |
||
65 | |||
66 | /** |
||
67 | * Get handlers handling $level and $entry type |
||
68 | * |
||
69 | * @param LogEntryInterface $entry |
||
70 | * @return \Traversable |
||
71 | */ |
||
72 | protected function getHandlers(LogEntryInterface $entry): \Traversable |
||
88 | |||
89 | /** |
||
90 | * @param string|object $entryClass |
||
91 | * @param string $requiredClass |
||
92 | * @return string |
||
93 | * @throws \InvalidArgumentException if not valid message entry |
||
94 | */ |
||
95 | protected function checkEntry($entryClass, string $requiredClass): string |
||
102 | |||
103 | /** |
||
104 | * @param LogEntryInterface $entry |
||
105 | * @param string $level |
||
106 | * @return UniquePriorityQueue |
||
107 | */ |
||
108 | protected function findHandlers(LogEntryInterface $entry, string $level): UniquePriorityQueue |
||
125 | |||
126 | /** |
||
127 | * return TRUE if can handle the entry level |
||
128 | * |
||
129 | * @param string $entryLevel |
||
130 | * @param string $handlerLevel |
||
131 | * @return bool |
||
132 | */ |
||
133 | protected function matchLevel(string $entryLevel, string $handlerLevel): bool |
||
140 | } |