PluginProbe
Media Cloud Sync / 1.4.2
Media Cloud Sync v1.4.2
1.4.2 1.4.1 1.4.0 1.3.12 1.3.11 1.3.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.2.0 1.2.10 1.2.11 1.2.12 1.2.13 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 All 36 releases
media-cloud-sync / includes / sdk / google / monolog / monolog / src / Monolog / Handler / AbstractProcessingHandler.php

AbstractProcessingHandler.php in Media Cloud Sync 1.4.2, at includes/sdk/google/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php

52 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 declare (strict_types=1);
4 /*
5 * This file is part of the Monolog package.
6 *
7 * (c) Jordi Boggiano <[email protected]>
8 *
9 * For the full copyright and license information, please view the LICENSE
10 * file that was distributed with this source code.
11 */
12 namespace Dudlewebs\WPMCS\GCP\Monolog\Handler;
13
14 use Dudlewebs\WPMCS\GCP\Monolog\LogRecord;
15 /**
16 * Base Handler class providing the Handler structure, including processors and formatters
17 *
18 * Classes extending it should (in most cases) only implement write($record)
19 *
20 * @author Jordi Boggiano <[email protected]>
21 * @author Christophe Coevoet <[email protected]>
22 */
23 abstract class AbstractProcessingHandler extends AbstractHandler implements ProcessableHandlerInterface, FormattableHandlerInterface
24 {
25 use ProcessableHandlerTrait;
26 use FormattableHandlerTrait;
27 /**
28 * @inheritDoc
29 */
30 public function handle(LogRecord $record) : bool
31 {
32 if (!$this->isHandling($record)) {
33 return \false;
34 }
35 if (\count($this->processors) > 0) {
36 $record = $this->processRecord($record);
37 }
38 $record->formatted = $this->getFormatter()->format($record);
39 $this->write($record);
40 return \false === $this->bubble;
41 }
42 /**
43 * Writes the (already formatted) record down to the log of the implementing handler
44 */
45 protected abstract function write(LogRecord $record) : void;
46 public function reset() : void
47 {
48 parent::reset();
49 $this->resetProcessors();
50 }
51 }
52