AdaptiveHandler::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 5
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