AdaptiveHandler::write()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of Ekino New Relic bundle.
7
 *
8
 * (c) Ekino - Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Ekino\NewRelicBundle\Logging;
15
16
use Monolog\Handler\NewRelicHandler;
17
use Psr\Log\LogLevel;
18
19
class AdaptiveHandler extends NewRelicHandler
20
{
21
    public function __construct(
22
        string $level = LogLevel::ERROR,
23
        bool $bubble = true,
24
        string $appName = null,
25
        bool $explodeArrays = false,
26
        string $transactionName = null
27
    ) {
28
        parent::__construct($level, $bubble, $appName, $explodeArrays, $transactionName);
29
    }
30
31
    protected function write(array $record): void
32
    {
33
        if (!$this->isNewRelicEnabled()) {
34
            return;
35
        }
36
37
        parent::write($record);
38
    }
39
}
40