PluginProbe
ManageWP Worker / 4.9.25
ManageWP Worker v4.9.25
4.9.38 4.9.37 4.9.36 4.9.35 4.9.34 3.8.7 3.8.8 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.18 3.9.19 3.9.2 3.9.20 3.9.21 3.9.22 3.9.23 3.9.24 All 73 releases
worker / src / Monolog / Handler / AbstractProcessingHandler.php

AbstractProcessingHandler.php in ManageWP Worker 4.9.25, at src/Monolog/Handler/AbstractProcessingHandler.php

67 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 * Base Handler class providing the Handler structure
14 *
15 * Classes extending it should (in most cases) only implement write($record)
16 *
17 * @author Jordi Boggiano <j.boggiano@seld.be>
18 * @author Christophe Coevoet <stof@notk.org>
19 */
20 abstract class Monolog_Handler_AbstractProcessingHandler extends Monolog_Handler_AbstractHandler
21 {
22 /**
23 * {@inheritdoc}
24 */
25 public function handle(array $record)
26 {
27 if (!$this->isHandling($record)) {
28 return false;
29 }
30
31 $record = $this->processRecord($record);
32
33 $record['formatted'] = $this->getFormatter()->format($record);
34
35 $this->write($record);
36
37 return false === $this->bubble;
38 }
39
40 /**
41 * Writes the record down to the log of the implementing handler
42 *
43 * @param array $record
44 *
45 * @return void
46 */
47 abstract protected function write(array $record);
48
49 /**
50 * Processes a record.
51 *
52 * @param array $record
53 *
54 * @return array
55 */
56 protected function processRecord(array $record)
57 {
58 if ($this->processors) {
59 foreach ($this->processors as $processor) {
60 $record = call_user_func($processor, $record);
61 }
62 }
63
64 return $record;
65 }
66 }
67