PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / trunk
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance vtrunk
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / vendor / monolog / monolog / src / Monolog / Handler / DoctrineCouchDBHandler.php

DoctrineCouchDBHandler.php in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance trunk, at vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php

48 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php declare(strict_types=1);
2
3 /*
4 * This file is part of the Monolog package.
5 *
6 * (c) Jordi Boggiano <[email protected]>
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 namespace Monolog\Handler;
13
14 use Monolog\Logger;
15 use Monolog\Formatter\NormalizerFormatter;
16 use Monolog\Formatter\FormatterInterface;
17 use Doctrine\CouchDB\CouchDBClient;
18
19 /**
20 * CouchDB handler for Doctrine CouchDB ODM
21 *
22 * @author Markus Bachmann <[email protected]>
23 */
24 class DoctrineCouchDBHandler extends AbstractProcessingHandler
25 {
26 /** @var CouchDBClient */
27 private $client;
28
29 public function __construct(CouchDBClient $client, $level = Logger::DEBUG, bool $bubble = true)
30 {
31 $this->client = $client;
32 parent::__construct($level, $bubble);
33 }
34
35 /**
36 * {@inheritDoc}
37 */
38 protected function write(array $record): void
39 {
40 $this->client->postDocument($record['formatted']);
41 }
42
43 protected function getDefaultFormatter(): FormatterInterface
44 {
45 return new NormalizerFormatter;
46 }
47 }
48