1 | <?php |
||
31 | trait ExtendedLoggerTrait |
||
32 | { |
||
33 | use GlobbingTrait; |
||
34 | |||
35 | /** |
||
36 | * Collection of handler queues |
||
37 | * |
||
38 | * @var array |
||
39 | * @access protected |
||
40 | */ |
||
41 | protected $handlers = []; |
||
42 | |||
43 | /** |
||
44 | * Collection of processor queues |
||
45 | * |
||
46 | * @var array |
||
47 | * @access protected |
||
48 | */ |
||
49 | protected $processors = []; |
||
50 | |||
51 | /** |
||
52 | * default channel name |
||
53 | * |
||
54 | * @var string |
||
55 | * @access protected |
||
56 | */ |
||
57 | protected $default_channel; |
||
58 | |||
59 | /** |
||
60 | * Current channel name |
||
61 | * |
||
62 | * @var string |
||
63 | * @access protected |
||
64 | */ |
||
65 | protected $current_channel; |
||
66 | |||
67 | /** |
||
68 | * Get current channel, if not set, get the default channel |
||
69 | * |
||
70 | * @return string |
||
71 | * @access protected |
||
72 | */ |
||
73 | protected function getChannel()/*# : string */ |
||
77 | |||
78 | /** |
||
79 | * Add callable to the $type queue |
||
80 | * |
||
81 | * @param string $type 'handlers' or 'processors' |
||
82 | * @param callable $callable |
||
83 | * @param string $channel |
||
84 | * @param int $priority -100 - +100 |
||
85 | * @return $this |
||
86 | * @access protected |
||
87 | */ |
||
88 | protected function addCallable( |
||
107 | |||
108 | /** |
||
109 | * Remove callable for $type |
||
110 | * |
||
111 | * @param string $type |
||
112 | * @param callable|string $callableOrClassname |
||
113 | * @param string $channel |
||
114 | * @return $this |
||
115 | * @access protected |
||
116 | */ |
||
117 | protected function removeCallable( |
||
134 | |||
135 | /** |
||
136 | * Remove callable or matching classname object from the queue |
||
137 | * |
||
138 | * @param PriorityQueueInterface $queue |
||
139 | * @param callable|string $callabOrClassname |
||
140 | * @access protected |
||
141 | */ |
||
142 | protected function removeFromQueue( |
||
156 | |||
157 | /** |
||
158 | * Get all the channels for handlers or processors |
||
159 | * |
||
160 | * @param string $type 'handlers' or 'processors' |
||
161 | * @return array |
||
162 | * @access protected |
||
163 | */ |
||
164 | protected function getAllChannels(/*# string */ $type)/*# : array */ |
||
168 | |||
169 | /** |
||
170 | * Execute related processors on the log entry |
||
171 | * |
||
172 | * @param LogEntryInterface $logEntry |
||
173 | * @return $this |
||
174 | * @access protected |
||
175 | */ |
||
176 | protected function runProcessors(LogEntryInterface $logEntry) |
||
189 | |||
190 | /** |
||
191 | * Execute related handlers on the log entry |
||
192 | * |
||
193 | * @param LogEntryInterface $logEntry |
||
194 | * @return $this |
||
195 | * @access protected |
||
196 | */ |
||
197 | protected function runHandlers(LogEntryInterface $logEntry) |
||
216 | |||
217 | /** |
||
218 | * Get all matching handlers/processors with channel name globbing |
||
219 | * |
||
220 | * @param string $type |
||
221 | * @param string $channel |
||
222 | * @return PriorityQueue |
||
223 | * @access protected |
||
224 | */ |
||
225 | protected function getCallables( |
||
246 | } |
||
247 |