Completed
Push — feature-20rc1 ( 008ae2 )
by Rob
16:55
created

Logger   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 2
A log() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the `liip/LiipImagineBundle` project.
5
 *
6
 * (c) https://github.com/liip/LiipImagineBundle/graphs/contributors
7
 *
8
 * For the full copyright and license information, please view the LICENSE.md
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Liip\ImagineBundle\Log;
13
14
use Psr\Log\AbstractLogger;
15
use Psr\Log\LoggerInterface;
16
use Psr\Log\NullLogger;
17
18
/**
19
 * @author Rob Frawley 2nd <[email protected]>
20
 */
21
class Logger extends AbstractLogger implements LoggerInterface
22
{
23
    /**
24
     * @var LoggerInterface
25
     */
26
    private $logger;
27
28
    /**
29
     * @param LoggerInterface|null $logger
30
     */
31
    public function __construct(LoggerInterface $logger = null)
32
    {
33
        $this->logger = $logger ?: new NullLogger();
34
    }
35
36
    /**
37
     * @param mixed  $level
38
     * @param string $message
39
     * @param array  $context
40
     */
41
    public function log($level, $message, array $context = [])
42
    {
43
        $this->logger->log($level, $message, $context);
44
    }
45
}
46