ErrorLogger::log()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Bouncer package.
5
 *
6
 * (c) François Hodierne <[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 Bouncer\Logger;
13
14
class ErrorLogger extends BaseLogger
15
{
16
17
    /**
18
     * {@inheritDoc}
19
     */
20
    public function log(array $logEntry)
21
    {
22
        $entry = $this->format($logEntry);
23
24
        if (defined('JSON_PRETTY_PRINT')) {
25
          error_log(json_encode($entry, JSON_PRETTY_PRINT));
26
        } else {
27
          error_log(json_encode($entry));
28
        }
29
    }
30
31
}
32