1 | <?php |
||
33 | trait ExtendedLoggerTrait |
||
34 | { |
||
35 | use GlobbingTrait; |
||
36 | |||
37 | /** |
||
38 | * Collection of handler queues |
||
39 | * |
||
40 | * @var array |
||
41 | * @access protected |
||
42 | */ |
||
43 | protected $handlers = []; |
||
44 | |||
45 | /** |
||
46 | * Collection of processor queues |
||
47 | * |
||
48 | * @var array |
||
49 | * @access protected |
||
50 | */ |
||
51 | protected $processors = []; |
||
52 | |||
53 | /** |
||
54 | * default channel name |
||
55 | * |
||
56 | * @var string |
||
57 | * @access protected |
||
58 | */ |
||
59 | protected $default_channel; |
||
60 | |||
61 | /** |
||
62 | * Current channel name |
||
63 | * |
||
64 | * @var string |
||
65 | * @access protected |
||
66 | */ |
||
67 | protected $current_channel; |
||
68 | |||
69 | /** |
||
70 | * Get current channel, if not set, get the default channel |
||
71 | * |
||
72 | * @return string |
||
73 | * @access protected |
||
74 | */ |
||
75 | protected function getChannel()/*# : string */ |
||
79 | |||
80 | /** |
||
81 | * Add callable to the $type queue |
||
82 | * |
||
83 | * @param string $type 'handlers' or 'processors' |
||
84 | * @param callable $callable |
||
85 | * @param string $channel |
||
86 | * @param int $priority -100 - +100 |
||
87 | * @param string $level |
||
88 | * @return $this |
||
89 | * @access protected |
||
90 | * @since 2.0.1 added level here |
||
91 | */ |
||
92 | protected function addCallable( |
||
112 | |||
113 | /** |
||
114 | * Remove callable for $type |
||
115 | * |
||
116 | * @param string $type |
||
117 | * @param callable|string $callableOrClassname |
||
118 | * @param string $channel |
||
119 | * @return $this |
||
120 | * @access protected |
||
121 | */ |
||
122 | protected function removeCallable( |
||
139 | |||
140 | /** |
||
141 | * Remove callable or matching classname object from the queue |
||
142 | * |
||
143 | * @param PriorityQueueInterface $queue |
||
144 | * @param callable|string $callabOrClassname |
||
145 | * @access protected |
||
146 | */ |
||
147 | protected function removeFromQueue( |
||
161 | |||
162 | /** |
||
163 | * Get all the channels for handlers or processors |
||
164 | * |
||
165 | * @param string $type 'handlers' or 'processors' |
||
166 | * @return array |
||
167 | * @access protected |
||
168 | */ |
||
169 | protected function getAllChannels(/*# string */ $type)/*# : array */ |
||
173 | |||
174 | /** |
||
175 | * Execute related processors on the log entry |
||
176 | * |
||
177 | * @param LogEntryInterface $logEntry |
||
178 | * @return $this |
||
179 | * @access protected |
||
180 | */ |
||
181 | protected function runProcessors(LogEntryInterface $logEntry) |
||
193 | |||
194 | /** |
||
195 | * Execute related handlers on the log entry |
||
196 | * |
||
197 | * @param LogEntryInterface $logEntry |
||
198 | * @return $this |
||
199 | * @access protected |
||
200 | * @since 2.0.1 added level checking here |
||
201 | */ |
||
202 | protected function runHandlers(LogEntryInterface $logEntry) |
||
223 | |||
224 | /** |
||
225 | * Get all matching handlers/processors with channel name globbing |
||
226 | * |
||
227 | * @param string $type |
||
228 | * @param string $channel |
||
229 | * @return PriorityQueue |
||
230 | * @access protected |
||
231 | */ |
||
232 | protected function getCallables( |
||
254 | } |
||
255 |